diff options
author | 2017-08-23 14:22:20 -0700 | |
---|---|---|
committer | 2017-10-11 14:31:20 -0700 | |
commit | 4cdc58f6840d15b4952149d2b345ec1f97d505bc (patch) | |
tree | 33427f28bf11a635036f582ac94384ac57ce7fcf /cmds/flatland/GLHelper.cpp | |
parent | 049c1147a12684a6f95c6d8b326dc29208908d14 (diff) |
SurfaceFlinger Transactions as distinct objects.
Essentially a process global singleton for transactions is not so useful once
we make surface control public API as process isn't something an app developer
is really thinking about. It's also nice that we get to delete two of the plumbing layers.
Test: Boots
Change-Id: I8864bd7e2f5865e3c0a425cf82f9928211911774
Diffstat (limited to 'cmds/flatland/GLHelper.cpp')
-rw-r--r-- | cmds/flatland/GLHelper.cpp | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/cmds/flatland/GLHelper.cpp b/cmds/flatland/GLHelper.cpp index dfc3e581fd..d5b3372f96 100644 --- a/cmds/flatland/GLHelper.cpp +++ b/cmds/flatland/GLHelper.cpp @@ -269,24 +269,10 @@ bool GLHelper::createWindowSurface(uint32_t w, uint32_t h, return false; } - SurfaceComposerClient::openGlobalTransaction(); - err = sc->setLayer(0x7FFFFFFF); - if (err != NO_ERROR) { - fprintf(stderr, "SurfaceComposer::setLayer error: %#x\n", err); - return false; - } - err = sc->setMatrix(scale, 0.0f, 0.0f, scale); - if (err != NO_ERROR) { - fprintf(stderr, "SurfaceComposer::setMatrix error: %#x\n", err); - return false; - } - - err = sc->show(); - if (err != NO_ERROR) { - fprintf(stderr, "SurfaceComposer::show error: %#x\n", err); - return false; - } - SurfaceComposerClient::closeGlobalTransaction(); + SurfaceComposerClient::Transaction{}.setLayer(sc, 0x7FFFFFFF) + .setMatrix(sc, scale, 0.0f, 0.0f, scale) + .show(sc) + .apply(); sp<ANativeWindow> anw = sc->getSurface(); EGLSurface s = eglCreateWindowSurface(mDisplay, mConfig, anw.get(), NULL); |