summaryrefslogtreecommitdiff
path: root/native
diff options
context:
space:
mode:
authorStan Iliev <stani@google.com>2019-09-17 14:07:23 -0400
committerStan Iliev <stani@google.com>2019-11-08 15:37:17 +0000
commitaaa9e834d443a56671eccbe97c755c253fa94afe (patch)
treee67daf0782137e572f6be35e9a24b146c4fd4b57 /native
parent707ba29a6621220c2713468bf095178dcc1e376e (diff)
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
Diffstat (limited to 'native')
-rw-r--r--native/android/surface_texture.cpp16
1 files changed, 5 insertions, 11 deletions
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 <gui/Surface.h>
-#include <android_runtime/android_graphics_SurfaceTexture.h>
+#include <gui/surfacetexture/surface_texture_platform.h>
-#include "surfacetexture/SurfaceTexture.h"
+#include <android_runtime/android_graphics_SurfaceTexture.h>
using namespace android;
-struct ASurfaceTexture {
- sp<SurfaceTexture> consumer;
- sp<IGraphicBufferProducer> 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) {