From aaa9e834d443a56671eccbe97c755c253fa94afe Mon Sep 17 00:00:00 2001 From: Stan Iliev Date: Tue, 17 Sep 2019 14:07:23 -0400 Subject: Decouple SurfaceTexture from HWUI Remove all Skia and HWUI types from SurfaceTexture implementation. Move SurfaceTexture to libgui (ag/9578265). Define private C++ API for SurfaceTexture, which is consumed by DeferredLayerUpdater. Move AutoBackendTextureRelease/Skia code from SurfaceTexture to HWUI. Test: pass CtsUiRenderingTestCases and CtsViewTestCases Bug: 136263580 Change-Id: I3f971bb490f64a3ac0b2a66a89ba935bf7f08213 --- native/android/surface_texture.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'native/android') diff --git a/native/android/surface_texture.cpp b/native/android/surface_texture.cpp index ced2792775d4..3049ec16e2d4 100644 --- a/native/android/surface_texture.cpp +++ b/native/android/surface_texture.cpp @@ -23,25 +23,19 @@ #include -#include +#include -#include "surfacetexture/SurfaceTexture.h" +#include using namespace android; -struct ASurfaceTexture { - sp consumer; - sp producer; -}; - ASurfaceTexture* ASurfaceTexture_fromSurfaceTexture(JNIEnv* env, jobject surfacetexture) { if (!surfacetexture || !android_SurfaceTexture_isInstanceOf(env, surfacetexture)) { return nullptr; } - ASurfaceTexture* ast = new ASurfaceTexture; - ast->consumer = SurfaceTexture_getSurfaceTexture(env, surfacetexture); - ast->producer = SurfaceTexture_getProducer(env, surfacetexture); - return ast; + auto consumer = SurfaceTexture_getSurfaceTexture(env, surfacetexture); + auto producer = SurfaceTexture_getProducer(env, surfacetexture); + return ASurfaceTexture_create(consumer, producer); } ANativeWindow* ASurfaceTexture_acquireANativeWindow(ASurfaceTexture* st) { -- cgit v1.2.3-59-g8ed1b