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
This commit is contained in:
Stan Iliev
2019-09-17 14:07:23 -04:00
parent 707ba29a66
commit aaa9e834d4
23 changed files with 404 additions and 2464 deletions

View File

@@ -23,25 +23,19 @@
#include <gui/Surface.h>
#include <gui/surfacetexture/surface_texture_platform.h>
#include <android_runtime/android_graphics_SurfaceTexture.h>
#include "surfacetexture/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) {