diff options
author | Mathias Agopian <mathias@google.com> | 2013-02-14 17:11:02 -0800 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2013-02-14 19:19:05 -0800 |
commit | e3c697fb929c856b59fa56a8e05a2a7eba187c3d (patch) | |
tree | fccd3662a79ea1af6124365763f2ebc8db7f6c45 /services/surfaceflinger/tests/resize | |
parent | 82052cff2c4da7a2af650cdd6bb7d21293742178 (diff) | |
download | frameworks_native-e3c697fb929c856b59fa56a8e05a2a7eba187c3d.zip frameworks_native-e3c697fb929c856b59fa56a8e05a2a7eba187c3d.tar.gz frameworks_native-e3c697fb929c856b59fa56a8e05a2a7eba187c3d.tar.bz2 |
Refactoring: Rename SurfaceTextureClient to Surface
Change-Id: Ibed34175ae273608393aaa5f0a7df207dc40d709
Diffstat (limited to 'services/surfaceflinger/tests/resize')
-rw-r--r-- | services/surfaceflinger/tests/resize/resize.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/services/surfaceflinger/tests/resize/resize.cpp b/services/surfaceflinger/tests/resize/resize.cpp index d61ea70..8b051e8 100644 --- a/services/surfaceflinger/tests/resize/resize.cpp +++ b/services/surfaceflinger/tests/resize/resize.cpp @@ -38,26 +38,27 @@ int main(int argc, char** argv) // create a client to surfaceflinger sp<SurfaceComposerClient> client = new SurfaceComposerClient(); - sp<Surface> surface = client->createSurface(String8("resize"), + sp<SurfaceControl> surfaceControl = client->createSurface(String8("resize"), 160, 240, PIXEL_FORMAT_RGB_565, 0); + sp<Surface> surface = surfaceControl->getSurface(); SurfaceComposerClient::openGlobalTransaction(); - surface->setLayer(100000); + surfaceControl->setLayer(100000); SurfaceComposerClient::closeGlobalTransaction(); - Surface::SurfaceInfo info; - surface->lock(&info); - ssize_t bpr = info.s * bytesPerPixel(info.format); - android_memset16((uint16_t*)info.bits, 0xF800, bpr*info.h); + ANativeWindow_Buffer outBuffer; + surface->lock(&outBuffer, NULL); + ssize_t bpr = outBuffer.stride * bytesPerPixel(outBuffer.format); + android_memset16((uint16_t*)outBuffer.bits, 0xF800, bpr*outBuffer.height); surface->unlockAndPost(); - surface->lock(&info); - android_memset16((uint16_t*)info.bits, 0x07E0, bpr*info.h); + surface->lock(&outBuffer); + android_memset16((uint16_t*)outBuffer.bits, 0x07E0, bpr*outBuffer.height); surface->unlockAndPost(); SurfaceComposerClient::openGlobalTransaction(); - surface->setSize(320, 240); + surfaceControl->setSize(320, 240); SurfaceComposerClient::closeGlobalTransaction(); |