diff --git a/include/gui/SurfaceTextureClient.h b/include/gui/SurfaceTextureClient.h index 61ccbcb76..c77bc4cd2 100644 --- a/include/gui/SurfaceTextureClient.h +++ b/include/gui/SurfaceTextureClient.h @@ -45,20 +45,20 @@ private: SurfaceTextureClient(const SurfaceTextureClient& rhs); // ANativeWindow hooks - static int cancelBuffer(ANativeWindow* window, android_native_buffer_t* buffer); - static int dequeueBuffer(ANativeWindow* window, android_native_buffer_t** buffer); - static int lockBuffer(ANativeWindow* window, android_native_buffer_t* buffer); + static int cancelBuffer(ANativeWindow* window, ANativeWindowBuffer* buffer); + static int dequeueBuffer(ANativeWindow* window, ANativeWindowBuffer** buffer); + static int lockBuffer(ANativeWindow* window, ANativeWindowBuffer* buffer); static int perform(ANativeWindow* window, int operation, ...); static int query(const ANativeWindow* window, int what, int* value); - static int queueBuffer(ANativeWindow* window, android_native_buffer_t* buffer); + static int queueBuffer(ANativeWindow* window, ANativeWindowBuffer* buffer); static int setSwapInterval(ANativeWindow* window, int interval); - int cancelBuffer(android_native_buffer_t* buffer); - int dequeueBuffer(android_native_buffer_t** buffer); - int lockBuffer(android_native_buffer_t* buffer); + int cancelBuffer(ANativeWindowBuffer* buffer); + int dequeueBuffer(ANativeWindowBuffer** buffer); + int lockBuffer(ANativeWindowBuffer* buffer); int perform(int operation, va_list args); int query(int what, int* value) const; - int queueBuffer(android_native_buffer_t* buffer); + int queueBuffer(ANativeWindowBuffer* buffer); int setSwapInterval(int interval); int dispatchConnect(va_list args); diff --git a/include/surfaceflinger/Surface.h b/include/surfaceflinger/Surface.h index 31f249609..ab30f45dd 100644 --- a/include/surfaceflinger/Surface.h +++ b/include/surfaceflinger/Surface.h @@ -202,17 +202,17 @@ private: * ANativeWindow hooks */ static int setSwapInterval(ANativeWindow* window, int interval); - static int dequeueBuffer(ANativeWindow* window, android_native_buffer_t** buffer); - static int cancelBuffer(ANativeWindow* window, android_native_buffer_t* buffer); - static int lockBuffer(ANativeWindow* window, android_native_buffer_t* buffer); - static int queueBuffer(ANativeWindow* window, android_native_buffer_t* buffer); + static int dequeueBuffer(ANativeWindow* window, ANativeWindowBuffer** buffer); + static int cancelBuffer(ANativeWindow* window, ANativeWindowBuffer* buffer); + static int lockBuffer(ANativeWindow* window, ANativeWindowBuffer* buffer); + static int queueBuffer(ANativeWindow* window, ANativeWindowBuffer* buffer); static int query(const ANativeWindow* window, int what, int* value); static int perform(ANativeWindow* window, int operation, ...); - int dequeueBuffer(android_native_buffer_t** buffer); - int lockBuffer(android_native_buffer_t* buffer); - int queueBuffer(android_native_buffer_t* buffer); - int cancelBuffer(android_native_buffer_t* buffer); + int dequeueBuffer(ANativeWindowBuffer** buffer); + int lockBuffer(ANativeWindowBuffer* buffer); + int queueBuffer(ANativeWindowBuffer* buffer); + int cancelBuffer(ANativeWindowBuffer* buffer); int query(int what, int* value) const; int perform(int operation, va_list args); diff --git a/include/ui/FramebufferNativeWindow.h b/include/ui/FramebufferNativeWindow.h index 3e67f9689..302d01239 100644 --- a/include/ui/FramebufferNativeWindow.h +++ b/include/ui/FramebufferNativeWindow.h @@ -67,9 +67,9 @@ private: friend class LightRefBase; ~FramebufferNativeWindow(); // this class cannot be overloaded static int setSwapInterval(ANativeWindow* window, int interval); - static int dequeueBuffer(ANativeWindow* window, android_native_buffer_t** buffer); - static int lockBuffer(ANativeWindow* window, android_native_buffer_t* buffer); - static int queueBuffer(ANativeWindow* window, android_native_buffer_t* buffer); + static int dequeueBuffer(ANativeWindow* window, ANativeWindowBuffer** buffer); + static int lockBuffer(ANativeWindow* window, ANativeWindowBuffer* buffer); + static int queueBuffer(ANativeWindow* window, ANativeWindowBuffer* buffer); static int query(const ANativeWindow* window, int what, int* value); static int perform(ANativeWindow* window, int operation, ...); diff --git a/include/ui/GraphicBuffer.h b/include/ui/GraphicBuffer.h index 02d6f8ffd..370253a9c 100644 --- a/include/ui/GraphicBuffer.h +++ b/include/ui/GraphicBuffer.h @@ -26,7 +26,7 @@ #include #include -struct android_native_buffer_t; +struct ANativeWindowBuffer; namespace android { @@ -38,7 +38,7 @@ class GraphicBufferMapper; class GraphicBuffer : public EGLNativeBase< - android_native_buffer_t, + ANativeWindowBuffer, GraphicBuffer, LightRefBase >, public Flattenable { @@ -74,8 +74,8 @@ public: GraphicBuffer(uint32_t w, uint32_t h, PixelFormat format, uint32_t usage, uint32_t stride, native_handle_t* handle, bool keepOwnership); - // create a buffer from an existing android_native_buffer_t - GraphicBuffer(android_native_buffer_t* buffer, bool keepOwnership); + // create a buffer from an existing ANativeWindowBuffer + GraphicBuffer(ANativeWindowBuffer* buffer, bool keepOwnership); // return status status_t initCheck() const; @@ -94,7 +94,7 @@ public: status_t lock(GGLSurface* surface, uint32_t usage); status_t unlock(); - android_native_buffer_t* getNativeBuffer() const; + ANativeWindowBuffer* getNativeBuffer() const; void setIndex(int index); int getIndex() const; @@ -149,7 +149,7 @@ private: // If we're wrapping another buffer then this reference will make sure it // doesn't get freed. - sp mWrappedBuffer; + sp mWrappedBuffer; }; }; // namespace android diff --git a/libs/gui/Surface.cpp b/libs/gui/Surface.cpp index 812bd6ab2..0c5767b8c 100644 --- a/libs/gui/Surface.cpp +++ b/libs/gui/Surface.cpp @@ -513,25 +513,25 @@ int Surface::setSwapInterval(ANativeWindow* window, int interval) { } int Surface::dequeueBuffer(ANativeWindow* window, - android_native_buffer_t** buffer) { + ANativeWindowBuffer** buffer) { Surface* self = getSelf(window); return self->dequeueBuffer(buffer); } int Surface::cancelBuffer(ANativeWindow* window, - android_native_buffer_t* buffer) { + ANativeWindowBuffer* buffer) { Surface* self = getSelf(window); return self->cancelBuffer(buffer); } int Surface::lockBuffer(ANativeWindow* window, - android_native_buffer_t* buffer) { + ANativeWindowBuffer* buffer) { Surface* self = getSelf(window); return self->lockBuffer(buffer); } int Surface::queueBuffer(ANativeWindow* window, - android_native_buffer_t* buffer) { + ANativeWindowBuffer* buffer) { Surface* self = getSelf(window); return self->queueBuffer(buffer); } @@ -570,7 +570,7 @@ bool Surface::needNewBuffer(int bufIdx, return newNeewBuffer; } -int Surface::dequeueBuffer(android_native_buffer_t** buffer) +int Surface::dequeueBuffer(ANativeWindowBuffer** buffer) { status_t err = validate(); if (err != NO_ERROR) @@ -624,7 +624,7 @@ int Surface::dequeueBuffer(android_native_buffer_t** buffer) return err; } -int Surface::cancelBuffer(android_native_buffer_t* buffer) +int Surface::cancelBuffer(ANativeWindowBuffer* buffer) { status_t err = validate(true); switch (err) { @@ -651,7 +651,7 @@ int Surface::cancelBuffer(android_native_buffer_t* buffer) } -int Surface::lockBuffer(android_native_buffer_t* buffer) +int Surface::lockBuffer(ANativeWindowBuffer* buffer) { status_t err = validate(); if (err != NO_ERROR) @@ -670,7 +670,7 @@ int Surface::lockBuffer(android_native_buffer_t* buffer) return err; } -int Surface::queueBuffer(android_native_buffer_t* buffer) +int Surface::queueBuffer(ANativeWindowBuffer* buffer) { status_t err = validate(); if (err != NO_ERROR) @@ -969,7 +969,7 @@ status_t Surface::lock(SurfaceInfo* other, Region* dirtyIn, bool blocking) // we're intending to do software rendering from this point setUsage(GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN); - android_native_buffer_t* out; + ANativeWindowBuffer* out; status_t err = dequeueBuffer(&out); LOGE_IF(err, "dequeueBuffer failed (%s)", strerror(-err)); if (err == NO_ERROR) { @@ -1063,7 +1063,7 @@ int Surface::getBufferIndex(const sp& buffer) const if (idx < 0) { // The buffer doesn't have an index set. See if the handle the same as // one of the buffers for which we do know the index. This can happen - // e.g. if GraphicBuffer is used to wrap an android_native_buffer_t that + // e.g. if GraphicBuffer is used to wrap an ANativeWindowBuffer that // was dequeued from an ANativeWindow. for (size_t i = 0; i < mBuffers.size(); i++) { if (mBuffers[i] != 0 && buffer->handle == mBuffers[i]->handle) { diff --git a/libs/gui/SurfaceTextureClient.cpp b/libs/gui/SurfaceTextureClient.cpp index 76314496e..ec6da4324 100644 --- a/libs/gui/SurfaceTextureClient.cpp +++ b/libs/gui/SurfaceTextureClient.cpp @@ -53,25 +53,25 @@ int SurfaceTextureClient::setSwapInterval(ANativeWindow* window, int interval) { } int SurfaceTextureClient::dequeueBuffer(ANativeWindow* window, - android_native_buffer_t** buffer) { + ANativeWindowBuffer** buffer) { SurfaceTextureClient* c = getSelf(window); return c->dequeueBuffer(buffer); } int SurfaceTextureClient::cancelBuffer(ANativeWindow* window, - android_native_buffer_t* buffer) { + ANativeWindowBuffer* buffer) { SurfaceTextureClient* c = getSelf(window); return c->cancelBuffer(buffer); } int SurfaceTextureClient::lockBuffer(ANativeWindow* window, - android_native_buffer_t* buffer) { + ANativeWindowBuffer* buffer) { SurfaceTextureClient* c = getSelf(window); return c->lockBuffer(buffer); } int SurfaceTextureClient::queueBuffer(ANativeWindow* window, - android_native_buffer_t* buffer) { + ANativeWindowBuffer* buffer) { SurfaceTextureClient* c = getSelf(window); return c->queueBuffer(buffer); } diff --git a/libs/gui/tests/SurfaceTextureClient_test.cpp b/libs/gui/tests/SurfaceTextureClient_test.cpp index db781dec0..753e93391 100644 --- a/libs/gui/tests/SurfaceTextureClient_test.cpp +++ b/libs/gui/tests/SurfaceTextureClient_test.cpp @@ -113,7 +113,7 @@ TEST_F(SurfaceTextureClientTest, BufferGeometryInvalidSizesFail) { TEST_F(SurfaceTextureClientTest, DefaultGeometryValues) { sp anw(mSTC); - android_native_buffer_t* buf; + ANativeWindowBuffer* buf; ASSERT_EQ(OK, anw->dequeueBuffer(anw.get(), &buf)); EXPECT_EQ(1, buf->width); EXPECT_EQ(1, buf->height); @@ -123,7 +123,7 @@ TEST_F(SurfaceTextureClientTest, DefaultGeometryValues) { TEST_F(SurfaceTextureClientTest, BufferGeometryCanBeSet) { sp anw(mSTC); - android_native_buffer_t* buf; + ANativeWindowBuffer* buf; EXPECT_EQ(OK, native_window_set_buffers_geometry(anw.get(), 16, 8, PIXEL_FORMAT_RGB_565)); ASSERT_EQ(OK, anw->dequeueBuffer(anw.get(), &buf)); EXPECT_EQ(16, buf->width); @@ -134,7 +134,7 @@ TEST_F(SurfaceTextureClientTest, BufferGeometryCanBeSet) { TEST_F(SurfaceTextureClientTest, BufferGeometryDefaultSizeSetFormat) { sp anw(mSTC); - android_native_buffer_t* buf; + ANativeWindowBuffer* buf; EXPECT_EQ(OK, native_window_set_buffers_geometry(anw.get(), 0, 0, PIXEL_FORMAT_RGB_565)); ASSERT_EQ(OK, anw->dequeueBuffer(anw.get(), &buf)); EXPECT_EQ(1, buf->width); @@ -145,7 +145,7 @@ TEST_F(SurfaceTextureClientTest, BufferGeometryDefaultSizeSetFormat) { TEST_F(SurfaceTextureClientTest, BufferGeometrySetSizeDefaultFormat) { sp anw(mSTC); - android_native_buffer_t* buf; + ANativeWindowBuffer* buf; EXPECT_EQ(OK, native_window_set_buffers_geometry(anw.get(), 16, 8, 0)); ASSERT_EQ(OK, anw->dequeueBuffer(anw.get(), &buf)); EXPECT_EQ(16, buf->width); @@ -156,7 +156,7 @@ TEST_F(SurfaceTextureClientTest, BufferGeometrySetSizeDefaultFormat) { TEST_F(SurfaceTextureClientTest, BufferGeometrySizeCanBeUnset) { sp anw(mSTC); - android_native_buffer_t* buf; + ANativeWindowBuffer* buf; EXPECT_EQ(OK, native_window_set_buffers_geometry(anw.get(), 16, 8, 0)); ASSERT_EQ(OK, anw->dequeueBuffer(anw.get(), &buf)); EXPECT_EQ(16, buf->width); @@ -173,7 +173,7 @@ TEST_F(SurfaceTextureClientTest, BufferGeometrySizeCanBeUnset) { TEST_F(SurfaceTextureClientTest, BufferGeometrySizeCanBeChangedWithoutFormat) { sp anw(mSTC); - android_native_buffer_t* buf; + ANativeWindowBuffer* buf; EXPECT_EQ(OK, native_window_set_buffers_geometry(anw.get(), 0, 0, PIXEL_FORMAT_RGB_565)); ASSERT_EQ(OK, anw->dequeueBuffer(anw.get(), &buf)); EXPECT_EQ(1, buf->width); @@ -191,7 +191,7 @@ TEST_F(SurfaceTextureClientTest, BufferGeometrySizeCanBeChangedWithoutFormat) { TEST_F(SurfaceTextureClientTest, SurfaceTextureSetDefaultSize) { sp anw(mSTC); sp st(mST); - android_native_buffer_t* buf; + ANativeWindowBuffer* buf; EXPECT_EQ(OK, st->setDefaultBufferSize(16, 8)); ASSERT_EQ(OK, anw->dequeueBuffer(anw.get(), &buf)); EXPECT_EQ(16, buf->width); @@ -203,7 +203,7 @@ TEST_F(SurfaceTextureClientTest, SurfaceTextureSetDefaultSize) { TEST_F(SurfaceTextureClientTest, SurfaceTextureSetDefaultSizeAfterDequeue) { sp anw(mSTC); sp st(mST); - android_native_buffer_t* buf[2]; + ANativeWindowBuffer* buf[2]; ASSERT_EQ(OK, anw->dequeueBuffer(anw.get(), &buf[0])); ASSERT_EQ(OK, anw->dequeueBuffer(anw.get(), &buf[1])); EXPECT_NE(buf[0], buf[1]); @@ -224,7 +224,7 @@ TEST_F(SurfaceTextureClientTest, SurfaceTextureSetDefaultSizeAfterDequeue) { TEST_F(SurfaceTextureClientTest, SurfaceTextureSetDefaultSizeVsGeometry) { sp anw(mSTC); sp st(mST); - android_native_buffer_t* buf[2]; + ANativeWindowBuffer* buf[2]; EXPECT_EQ(OK, st->setDefaultBufferSize(16, 8)); ASSERT_EQ(OK, anw->dequeueBuffer(anw.get(), &buf[0])); ASSERT_EQ(OK, anw->dequeueBuffer(anw.get(), &buf[1])); diff --git a/libs/gui/tests/SurfaceTexture_test.cpp b/libs/gui/tests/SurfaceTexture_test.cpp index 6c713439d..8747ba5c7 100644 --- a/libs/gui/tests/SurfaceTexture_test.cpp +++ b/libs/gui/tests/SurfaceTexture_test.cpp @@ -476,7 +476,7 @@ TEST_F(SurfaceTextureGLTest, TexturingFromCpuFilledYV12BufferNpot) { ASSERT_EQ(NO_ERROR, native_window_set_usage(mANW.get(), GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN)); - android_native_buffer_t* anb; + ANativeWindowBuffer* anb; ASSERT_EQ(NO_ERROR, mANW->dequeueBuffer(mANW.get(), &anb)); ASSERT_TRUE(anb != NULL); @@ -524,7 +524,7 @@ TEST_F(SurfaceTextureGLTest, DISABLED_TexturingFromCpuFilledYV12BufferPow2) { ASSERT_EQ(NO_ERROR, native_window_set_usage(mANW.get(), GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN)); - android_native_buffer_t* anb; + ANativeWindowBuffer* anb; ASSERT_EQ(NO_ERROR, mANW->dequeueBuffer(mANW.get(), &anb)); ASSERT_TRUE(anb != NULL); @@ -583,7 +583,7 @@ TEST_F(SurfaceTextureGLTest, TexturingFromCpuFilledYV12BufferWithCrop) { ASSERT_EQ(NO_ERROR, native_window_set_crop(mANW.get(), &crop)); - android_native_buffer_t* anb; + ANativeWindowBuffer* anb; ASSERT_EQ(NO_ERROR, mANW->dequeueBuffer(mANW.get(), &anb)); ASSERT_TRUE(anb != NULL); diff --git a/libs/gui/tests/Surface_test.cpp b/libs/gui/tests/Surface_test.cpp index 440a48b7c..35c864055 100644 --- a/libs/gui/tests/Surface_test.cpp +++ b/libs/gui/tests/Surface_test.cpp @@ -93,7 +93,7 @@ TEST_F(SurfaceTest, ScreenshotsOfProtectedBuffersFail) { ASSERT_EQ(NO_ERROR, native_window_set_usage(anw.get(), GRALLOC_USAGE_PROTECTED)); ASSERT_EQ(NO_ERROR, native_window_set_buffer_count(anw.get(), 3)); - android_native_buffer_t* buf = 0; + ANativeWindowBuffer* buf = 0; for (int i = 0; i < 4; i++) { // Loop to make sure SurfaceFlinger has retired a protected buffer. ASSERT_EQ(NO_ERROR, anw->dequeueBuffer(anw.get(), &buf)); diff --git a/libs/ui/FramebufferNativeWindow.cpp b/libs/ui/FramebufferNativeWindow.cpp index 0c820e5d7..439350423 100644 --- a/libs/ui/FramebufferNativeWindow.cpp +++ b/libs/ui/FramebufferNativeWindow.cpp @@ -47,16 +47,16 @@ namespace android { class NativeBuffer : public EGLNativeBase< - android_native_buffer_t, + ANativeWindowBuffer, NativeBuffer, LightRefBase > { public: NativeBuffer(int w, int h, int f, int u) : BASE() { - android_native_buffer_t::width = w; - android_native_buffer_t::height = h; - android_native_buffer_t::format = f; - android_native_buffer_t::usage = u; + ANativeWindowBuffer::width = w; + ANativeWindowBuffer::height = h; + ANativeWindowBuffer::format = f; + ANativeWindowBuffer::usage = u; } private: friend class LightRefBase; @@ -201,7 +201,7 @@ int FramebufferNativeWindow::getCurrentBufferIndex() const } int FramebufferNativeWindow::dequeueBuffer(ANativeWindow* window, - android_native_buffer_t** buffer) + ANativeWindowBuffer** buffer) { FramebufferNativeWindow* self = getSelf(window); Mutex::Autolock _l(self->mutex); @@ -229,7 +229,7 @@ int FramebufferNativeWindow::dequeueBuffer(ANativeWindow* window, } int FramebufferNativeWindow::lockBuffer(ANativeWindow* window, - android_native_buffer_t* buffer) + ANativeWindowBuffer* buffer) { FramebufferNativeWindow* self = getSelf(window); Mutex::Autolock _l(self->mutex); @@ -249,7 +249,7 @@ int FramebufferNativeWindow::lockBuffer(ANativeWindow* window, } int FramebufferNativeWindow::queueBuffer(ANativeWindow* window, - android_native_buffer_t* buffer) + ANativeWindowBuffer* buffer) { FramebufferNativeWindow* self = getSelf(window); Mutex::Autolock _l(self->mutex); diff --git a/libs/ui/GraphicBuffer.cpp b/libs/ui/GraphicBuffer.cpp index 97312a6d4..54a3ffa56 100644 --- a/libs/ui/GraphicBuffer.cpp +++ b/libs/ui/GraphicBuffer.cpp @@ -33,7 +33,7 @@ namespace android { // =========================================================================== -// Buffer and implementation of android_native_buffer_t +// Buffer and implementation of ANativeWindowBuffer // =========================================================================== GraphicBuffer::GraphicBuffer() @@ -77,7 +77,7 @@ GraphicBuffer::GraphicBuffer(uint32_t w, uint32_t h, handle = inHandle; } -GraphicBuffer::GraphicBuffer(android_native_buffer_t* buffer, bool keepOwnership) +GraphicBuffer::GraphicBuffer(ANativeWindowBuffer* buffer, bool keepOwnership) : BASE(), mOwner(keepOwnership ? ownHandle : ownNone), mBufferMapper(GraphicBufferMapper::get()), mInitCheck(NO_ERROR), mIndex(-1), mWrappedBuffer(buffer) @@ -119,9 +119,9 @@ void GraphicBuffer::dumpAllocationsToSystemLog() GraphicBufferAllocator::dumpToSystemLog(); } -android_native_buffer_t* GraphicBuffer::getNativeBuffer() const +ANativeWindowBuffer* GraphicBuffer::getNativeBuffer() const { - return static_cast( + return static_cast( const_cast(this)); } diff --git a/opengl/include/EGL/eglext.h b/opengl/include/EGL/eglext.h index 1ffcd563f..1123e1673 100644 --- a/opengl/include/EGL/eglext.h +++ b/opengl/include/EGL/eglext.h @@ -225,7 +225,7 @@ typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBNVPROC) (EGLSyncNV sync, EGL #ifndef EGL_ANDROID_image_native_buffer #define EGL_ANDROID_image_native_buffer 1 -struct android_native_buffer_t; +struct ANativeWindowBuffer; #define EGL_NATIVE_BUFFER_ANDROID 0x3140 /* eglCreateImageKHR target */ #endif diff --git a/opengl/libagl/TextureObjectManager.cpp b/opengl/libagl/TextureObjectManager.cpp index bbb82fc48..022de09dd 100644 --- a/opengl/libagl/TextureObjectManager.cpp +++ b/opengl/libagl/TextureObjectManager.cpp @@ -145,7 +145,7 @@ status_t EGLTextureObject::setSurface(GGLSurface const* s) return NO_ERROR; } -status_t EGLTextureObject::setImage(android_native_buffer_t* native_buffer) +status_t EGLTextureObject::setImage(ANativeWindowBuffer* native_buffer) { GGLSurface sur; sur.version = sizeof(GGLSurface); diff --git a/opengl/libagl/TextureObjectManager.h b/opengl/libagl/TextureObjectManager.h index 70e3bef6e..de9e03eab 100644 --- a/opengl/libagl/TextureObjectManager.h +++ b/opengl/libagl/TextureObjectManager.h @@ -48,7 +48,7 @@ public: ~EGLTextureObject(); status_t setSurface(GGLSurface const* s); - status_t setImage(android_native_buffer_t* buffer); + status_t setImage(ANativeWindowBuffer* buffer); void setImageBits(void* vaddr) { surface.data = (GGLubyte*)vaddr; } status_t reallocate(GLint level, @@ -80,7 +80,7 @@ public: GLint crop_rect[4]; GLint generate_mipmap; GLint direct; - android_native_buffer_t* buffer; + ANativeWindowBuffer* buffer; }; // ---------------------------------------------------------------------------- diff --git a/opengl/libagl/egl.cpp b/opengl/libagl/egl.cpp index 97e913ba1..0d03361b0 100644 --- a/opengl/libagl/egl.cpp +++ b/opengl/libagl/egl.cpp @@ -230,11 +230,11 @@ struct egl_window_surface_v2_t : public egl_surface_t virtual EGLBoolean setSwapRectangle(EGLint l, EGLint t, EGLint w, EGLint h); private: - status_t lock(android_native_buffer_t* buf, int usage, void** vaddr); - status_t unlock(android_native_buffer_t* buf); + status_t lock(ANativeWindowBuffer* buf, int usage, void** vaddr); + status_t unlock(ANativeWindowBuffer* buf); ANativeWindow* nativeWindow; - android_native_buffer_t* buffer; - android_native_buffer_t* previousBuffer; + ANativeWindowBuffer* buffer; + ANativeWindowBuffer* previousBuffer; gralloc_module_t const* module; int width; int height; @@ -322,8 +322,8 @@ private: }; void copyBlt( - android_native_buffer_t* dst, void* dst_vaddr, - android_native_buffer_t* src, void const* src_vaddr, + ANativeWindowBuffer* dst, void* dst_vaddr, + ANativeWindowBuffer* src, void const* src_vaddr, const Region& clip); Rect dirtyRegion; @@ -415,7 +415,7 @@ void egl_window_surface_v2_t::disconnect() } status_t egl_window_surface_v2_t::lock( - android_native_buffer_t* buf, int usage, void** vaddr) + ANativeWindowBuffer* buf, int usage, void** vaddr) { int err; @@ -425,7 +425,7 @@ status_t egl_window_surface_v2_t::lock( return err; } -status_t egl_window_surface_v2_t::unlock(android_native_buffer_t* buf) +status_t egl_window_surface_v2_t::unlock(ANativeWindowBuffer* buf) { if (!buf) return BAD_VALUE; int err = NO_ERROR; @@ -436,8 +436,8 @@ status_t egl_window_surface_v2_t::unlock(android_native_buffer_t* buf) } void egl_window_surface_v2_t::copyBlt( - android_native_buffer_t* dst, void* dst_vaddr, - android_native_buffer_t* src, void const* src_vaddr, + ANativeWindowBuffer* dst, void* dst_vaddr, + ANativeWindowBuffer* src, void const* src_vaddr, const Region& clip) { // NOTE: dst and src must be the same format @@ -2003,12 +2003,12 @@ EGLImageKHR eglCreateImageKHR(EGLDisplay dpy, EGLContext ctx, EGLenum target, return setError(EGL_BAD_PARAMETER, EGL_NO_IMAGE_KHR); } - android_native_buffer_t* native_buffer = (android_native_buffer_t*)buffer; + ANativeWindowBuffer* native_buffer = (ANativeWindowBuffer*)buffer; if (native_buffer->common.magic != ANDROID_NATIVE_BUFFER_MAGIC) return setError(EGL_BAD_PARAMETER, EGL_NO_IMAGE_KHR); - if (native_buffer->common.version != sizeof(android_native_buffer_t)) + if (native_buffer->common.version != sizeof(ANativeWindowBuffer)) return setError(EGL_BAD_PARAMETER, EGL_NO_IMAGE_KHR); switch (native_buffer->format) { @@ -2034,12 +2034,12 @@ EGLBoolean eglDestroyImageKHR(EGLDisplay dpy, EGLImageKHR img) return setError(EGL_BAD_DISPLAY, EGL_FALSE); } - android_native_buffer_t* native_buffer = (android_native_buffer_t*)img; + ANativeWindowBuffer* native_buffer = (ANativeWindowBuffer*)img; if (native_buffer->common.magic != ANDROID_NATIVE_BUFFER_MAGIC) return setError(EGL_BAD_PARAMETER, EGL_FALSE); - if (native_buffer->common.version != sizeof(android_native_buffer_t)) + if (native_buffer->common.version != sizeof(ANativeWindowBuffer)) return setError(EGL_BAD_PARAMETER, EGL_FALSE); native_buffer->common.decRef(&native_buffer->common); diff --git a/opengl/libagl/texture.cpp b/opengl/libagl/texture.cpp index eb9689551..8eb17c435 100644 --- a/opengl/libagl/texture.cpp +++ b/opengl/libagl/texture.cpp @@ -126,7 +126,7 @@ void ogles_lock_textures(ogles_context_t* c) for (int i=0 ; irasterizer.state.texture[i].enable) { texture_unit_t& u(c->textures.tmu[i]); - android_native_buffer_t* native_buffer = u.texture->buffer; + ANativeWindowBuffer* native_buffer = u.texture->buffer; if (native_buffer) { c->rasterizer.procs.activeTexture(c, i); hw_module_t const* pModule; @@ -154,7 +154,7 @@ void ogles_unlock_textures(ogles_context_t* c) for (int i=0 ; irasterizer.state.texture[i].enable) { texture_unit_t& u(c->textures.tmu[i]); - android_native_buffer_t* native_buffer = u.texture->buffer; + ANativeWindowBuffer* native_buffer = u.texture->buffer; if (native_buffer) { c->rasterizer.procs.activeTexture(c, i); hw_module_t const* pModule; @@ -1615,12 +1615,12 @@ void glEGLImageTargetTexture2DOES(GLenum target, GLeglImageOES image) return; } - android_native_buffer_t* native_buffer = (android_native_buffer_t*)image; + ANativeWindowBuffer* native_buffer = (ANativeWindowBuffer*)image; if (native_buffer->common.magic != ANDROID_NATIVE_BUFFER_MAGIC) { ogles_error(c, GL_INVALID_VALUE); return; } - if (native_buffer->common.version != sizeof(android_native_buffer_t)) { + if (native_buffer->common.version != sizeof(ANativeWindowBuffer)) { ogles_error(c, GL_INVALID_VALUE); return; } @@ -1643,12 +1643,12 @@ void glEGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image) return; } - android_native_buffer_t* native_buffer = (android_native_buffer_t*)image; + ANativeWindowBuffer* native_buffer = (ANativeWindowBuffer*)image; if (native_buffer->common.magic != ANDROID_NATIVE_BUFFER_MAGIC) { ogles_error(c, GL_INVALID_VALUE); return; } - if (native_buffer->common.version != sizeof(android_native_buffer_t)) { + if (native_buffer->common.version != sizeof(ANativeWindowBuffer)) { ogles_error(c, GL_INVALID_VALUE); return; } diff --git a/opengl/libagl2/src/egl.cpp b/opengl/libagl2/src/egl.cpp index ec5889d75..0d02ce66b 100644 --- a/opengl/libagl2/src/egl.cpp +++ b/opengl/libagl2/src/egl.cpp @@ -211,11 +211,11 @@ struct egl_window_surface_v2_t : public egl_surface_t { virtual EGLBoolean setSwapRectangle(EGLint l, EGLint t, EGLint w, EGLint h); private: - status_t lock(android_native_buffer_t* buf, int usage, void** vaddr); - status_t unlock(android_native_buffer_t* buf); + status_t lock(ANativeWindowBuffer* buf, int usage, void** vaddr); + status_t unlock(ANativeWindowBuffer* buf); ANativeWindow* nativeWindow; - android_native_buffer_t* buffer; - android_native_buffer_t* previousBuffer; + ANativeWindowBuffer* buffer; + ANativeWindowBuffer* previousBuffer; gralloc_module_t const* module; int width; int height; @@ -307,8 +307,8 @@ private: }; void copyBlt( - android_native_buffer_t* dst, void* dst_vaddr, - android_native_buffer_t* src, void const* src_vaddr, + ANativeWindowBuffer* dst, void* dst_vaddr, + ANativeWindowBuffer* src, void const* src_vaddr, const Region& clip); Rect dirtyRegion; @@ -407,7 +407,7 @@ void egl_window_surface_v2_t::disconnect() } status_t egl_window_surface_v2_t::lock( - android_native_buffer_t* buf, int usage, void** vaddr) + ANativeWindowBuffer* buf, int usage, void** vaddr) { int err; @@ -417,7 +417,7 @@ status_t egl_window_surface_v2_t::lock( return err; } -status_t egl_window_surface_v2_t::unlock(android_native_buffer_t* buf) +status_t egl_window_surface_v2_t::unlock(ANativeWindowBuffer* buf) { if (!buf) return BAD_VALUE; int err = NO_ERROR; @@ -428,8 +428,8 @@ status_t egl_window_surface_v2_t::unlock(android_native_buffer_t* buf) } void egl_window_surface_v2_t::copyBlt( - android_native_buffer_t* dst, void* dst_vaddr, - android_native_buffer_t* src, void const* src_vaddr, + ANativeWindowBuffer* dst, void* dst_vaddr, + ANativeWindowBuffer* src, void const* src_vaddr, const Region& clip) { // NOTE: dst and src must be the same format @@ -2105,12 +2105,12 @@ EGLImageKHR eglCreateImageKHR(EGLDisplay dpy, EGLContext ctx, EGLenum target, return setError(EGL_BAD_PARAMETER, EGL_NO_IMAGE_KHR); } - android_native_buffer_t* native_buffer = (android_native_buffer_t*)buffer; + ANativeWindowBuffer* native_buffer = (ANativeWindowBuffer*)buffer; if (native_buffer->common.magic != ANDROID_NATIVE_BUFFER_MAGIC) return setError(EGL_BAD_PARAMETER, EGL_NO_IMAGE_KHR); - if (native_buffer->common.version != sizeof(android_native_buffer_t)) + if (native_buffer->common.version != sizeof(ANativeWindowBuffer)) return setError(EGL_BAD_PARAMETER, EGL_NO_IMAGE_KHR); switch (native_buffer->format) { @@ -2136,12 +2136,12 @@ EGLBoolean eglDestroyImageKHR(EGLDisplay dpy, EGLImageKHR img) return setError(EGL_BAD_DISPLAY, EGL_FALSE); } - android_native_buffer_t* native_buffer = (android_native_buffer_t*)img; + ANativeWindowBuffer* native_buffer = (ANativeWindowBuffer*)img; if (native_buffer->common.magic != ANDROID_NATIVE_BUFFER_MAGIC) return setError(EGL_BAD_PARAMETER, EGL_FALSE); - if (native_buffer->common.version != sizeof(android_native_buffer_t)) + if (native_buffer->common.version != sizeof(ANativeWindowBuffer)) return setError(EGL_BAD_PARAMETER, EGL_FALSE); native_buffer->common.decRef(&native_buffer->common); diff --git a/services/surfaceflinger/TextureManager.cpp b/services/surfaceflinger/TextureManager.cpp index 9e24f90d5..bb63c3798 100644 --- a/services/surfaceflinger/TextureManager.cpp +++ b/services/surfaceflinger/TextureManager.cpp @@ -144,7 +144,7 @@ status_t TextureManager::initEglImage(Image* pImage, } // construct an EGL_NATIVE_BUFFER_ANDROID - android_native_buffer_t* clientBuf = buffer->getNativeBuffer(); + ANativeWindowBuffer* clientBuf = buffer->getNativeBuffer(); // create the new EGLImageKHR const EGLint attrs[] = { diff --git a/services/surfaceflinger/tests/surface/surface.cpp b/services/surfaceflinger/tests/surface/surface.cpp index 67ecf7e10..5265f9195 100644 --- a/services/surfaceflinger/tests/surface/surface.cpp +++ b/services/surfaceflinger/tests/surface/surface.cpp @@ -53,7 +53,7 @@ int main(int argc, char** argv) printf("window=%p\n", window); int err = native_window_set_buffer_count(window, 8); - android_native_buffer_t* buffer; + ANativeWindowBuffer* buffer; for (int i=0 ; i<8 ; i++) { window->dequeueBuffer(window, &buffer);