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 | |
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')
-rw-r--r-- | services/surfaceflinger/DisplayDevice.cpp | 2 | ||||
-rw-r--r-- | services/surfaceflinger/DisplayHardware/FramebufferSurface.cpp | 2 | ||||
-rw-r--r-- | services/surfaceflinger/DisplayHardware/HWComposer.cpp | 2 | ||||
-rw-r--r-- | services/surfaceflinger/SurfaceFlinger.cpp | 10 | ||||
-rw-r--r-- | services/surfaceflinger/SurfaceFlinger.h | 2 | ||||
-rw-r--r-- | services/surfaceflinger/tests/Transaction_test.cpp | 12 | ||||
-rw-r--r-- | services/surfaceflinger/tests/resize/resize.cpp | 19 |
7 files changed, 25 insertions, 24 deletions
diff --git a/services/surfaceflinger/DisplayDevice.cpp b/services/surfaceflinger/DisplayDevice.cpp index 19169a5..9466944 100644 --- a/services/surfaceflinger/DisplayDevice.cpp +++ b/services/surfaceflinger/DisplayDevice.cpp @@ -27,7 +27,7 @@ #include <ui/DisplayInfo.h> #include <ui/PixelFormat.h> -#include <gui/SurfaceTextureClient.h> +#include <gui/Surface.h> #include <GLES/gl.h> #include <EGL/egl.h> diff --git a/services/surfaceflinger/DisplayHardware/FramebufferSurface.cpp b/services/surfaceflinger/DisplayHardware/FramebufferSurface.cpp index cccb29b..7557e3f 100644 --- a/services/surfaceflinger/DisplayHardware/FramebufferSurface.cpp +++ b/services/surfaceflinger/DisplayHardware/FramebufferSurface.cpp @@ -29,7 +29,7 @@ #include <EGL/egl.h> #include <hardware/hardware.h> -#include <gui/SurfaceTextureClient.h> +#include <gui/Surface.h> #include <gui/GraphicBufferAlloc.h> #include <ui/GraphicBuffer.h> diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.cpp b/services/surfaceflinger/DisplayHardware/HWComposer.cpp index 7a24d4c..6f85f69 100644 --- a/services/surfaceflinger/DisplayHardware/HWComposer.cpp +++ b/services/surfaceflinger/DisplayHardware/HWComposer.cpp @@ -529,7 +529,7 @@ status_t HWComposer::setFramebufferTarget(int32_t id, DisplayData& disp(mDisplayData[id]); if (!disp.framebufferTarget) { // this should never happen, but apparently eglCreateWindowSurface() - // triggers a SurfaceTextureClient::queueBuffer() on some + // triggers a Surface::queueBuffer() on some // devices (!?) -- log and ignore. ALOGE("HWComposer: framebufferTarget is null"); // CallStack stack; diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index efcef92..09a1c59 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -39,7 +39,7 @@ #include <gui/BufferQueue.h> #include <gui/GuiConfig.h> #include <gui/IDisplayEventConnection.h> -#include <gui/SurfaceTextureClient.h> +#include <gui/Surface.h> #include <gui/GraphicBufferAlloc.h> #include <ui/GraphicBufferAllocator.h> @@ -503,7 +503,7 @@ status_t SurfaceFlinger::readyToRun() wp<IBinder> token = mBuiltinDisplays[i]; sp<FramebufferSurface> fbs = new FramebufferSurface(*mHwc, i); - sp<SurfaceTextureClient> stc = new SurfaceTextureClient( + sp<Surface> stc = new Surface( static_cast< sp<IGraphicBufferProducer> >(fbs->getBufferQueue())); sp<DisplayDevice> hw = new DisplayDevice(this, type, isSecure, token, stc, fbs, mEGLConfig); @@ -1182,7 +1182,7 @@ void SurfaceFlinger::handleTransactionLocked(uint32_t transactionFlags) const DisplayDeviceState& state(curr[i]); sp<FramebufferSurface> fbs; - sp<SurfaceTextureClient> stc; + sp<Surface> stc; if (!state.isVirtualDisplay()) { ALOGE_IF(state.surface!=NULL, @@ -1193,12 +1193,12 @@ void SurfaceFlinger::handleTransactionLocked(uint32_t transactionFlags) // for supported (by hwc) displays we provide our // own rendering surface fbs = new FramebufferSurface(*mHwc, state.type); - stc = new SurfaceTextureClient( + stc = new Surface( static_cast< sp<IGraphicBufferProducer> >( fbs->getBufferQueue())); } else { if (state.surface != NULL) { - stc = new SurfaceTextureClient(state.surface); + stc = new Surface(state.surface); } } diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h index 3cda6c0..e67f3f1 100644 --- a/services/surfaceflinger/SurfaceFlinger.h +++ b/services/surfaceflinger/SurfaceFlinger.h @@ -64,7 +64,7 @@ class LayerBase; class LayerBaseClient; class LayerDim; class LayerScreenshot; -class SurfaceTextureClient; +class Surface; // --------------------------------------------------------------------------- diff --git a/services/surfaceflinger/tests/Transaction_test.cpp b/services/surfaceflinger/tests/Transaction_test.cpp index 0592c5b..4d363c8 100644 --- a/services/surfaceflinger/tests/Transaction_test.cpp +++ b/services/surfaceflinger/tests/Transaction_test.cpp @@ -31,14 +31,14 @@ namespace android { // Fill an RGBA_8888 formatted surface with a single color. static void fillSurfaceRGBA8(const sp<SurfaceControl>& sc, uint8_t r, uint8_t g, uint8_t b) { - Surface::SurfaceInfo info; + ANativeWindow_Buffer outBuffer; sp<Surface> s = sc->getSurface(); ASSERT_TRUE(s != NULL); - ASSERT_EQ(NO_ERROR, s->lock(&info)); - uint8_t* img = reinterpret_cast<uint8_t*>(info.bits); - for (uint32_t y = 0; y < info.h; y++) { - for (uint32_t x = 0; x < info.w; x++) { - uint8_t* pixel = img + (4 * (y*info.s + x)); + ASSERT_EQ(NO_ERROR, s->lock(&outBuffer, NULL)); + uint8_t* img = reinterpret_cast<uint8_t*>(outBuffer.bits); + for (uint32_t y = 0; y < outBuffer.height; y++) { + for (uint32_t x = 0; x < outBuffer.width; x++) { + uint8_t* pixel = img + (4 * (y*outBuffer.stride + x)); pixel[0] = r; pixel[1] = g; pixel[2] = b; 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(); |