From 90df056f4d3d841b2af3e338bad5634cfbd4ec5c Mon Sep 17 00:00:00 2001 From: Fedor Kudasov Date: Wed, 19 Jun 2019 11:41:34 +0100 Subject: Split lighting out of SkiaPipeline ReorderBarierDrawables includes SkiaPipeline just for the sake of lighting, however SkiaPipeline brings much more unnecessary dependencies. Splitting lighting our of SkiaPipeline should make dependency resolution simpler. Bug: 117921091 Test: all tests should pass Change-Id: I6adf7c43555cfa3ff7090a1197fc11160d3a85ec --- libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp') diff --git a/libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp b/libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp index 8092b1d10659..e7efe2ff798b 100644 --- a/libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp +++ b/libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp @@ -18,6 +18,7 @@ #include "DeferredLayerUpdater.h" #include "LayerDrawable.h" +#include "LightingInfo.h" #include "SkiaPipeline.h" #include "SkiaProfileRenderer.h" #include "hwui/Bitmap.h" @@ -99,7 +100,7 @@ bool SkiaOpenGLPipeline::draw(const Frame& frame, const SkRect& screenDirty, con mRenderThread.getGrContext(), backendRT, this->getSurfaceOrigin(), colorType, mSurfaceColorSpace, &props)); - SkiaPipeline::updateLighting(lightGeometry, lightInfo); + LightingInfo::updateLighting(lightGeometry, lightInfo); renderFrame(*layerUpdateQueue, dirty, renderNodes, opaque, contentDrawBounds, surface, SkMatrix::I()); layerUpdateQueue->clear(); -- cgit v1.2.3 From 1863d94e9a32a210cfb50d7c22bbac30dc33e010 Mon Sep 17 00:00:00 2001 From: Derek Sollenberger Date: Wed, 5 Feb 2020 15:41:51 -0500 Subject: Ensure SkiaPipeline always has a valid colorspace. Previously we didn't assign a colorspace to the pipeline until it was provided a surface to render into. This resulted in undefined behavior if the application attempted to render an offscreen layer before the OS provided the main window with its surface. Now instead of deferring setting whether or not the application is wide gamut we do initialize it to a default setting when the pipeline is created. Bug: 148042673 Test: apct/device_boot_health_check_extra_postsubmit Change-Id: I84d743511e949ac977486470bb14eec936de7f88 --- libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp') diff --git a/libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp b/libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp index e7efe2ff798b..8d5acc631274 100644 --- a/libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp +++ b/libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp @@ -171,17 +171,15 @@ static void setBufferCount(ANativeWindow* window, uint32_t extraBuffers) { } bool SkiaOpenGLPipeline::setSurface(ANativeWindow* surface, SwapBehavior swapBehavior, - ColorMode colorMode, uint32_t extraBuffers) { + uint32_t extraBuffers) { if (mEglSurface != EGL_NO_SURFACE) { mEglManager.destroySurface(mEglSurface); mEglSurface = EGL_NO_SURFACE; } - setSurfaceColorProperties(colorMode); - if (surface) { mRenderThread.requireGlContext(); - auto newSurface = mEglManager.createSurface(surface, colorMode, mSurfaceColorSpace); + auto newSurface = mEglManager.createSurface(surface, mColorMode, mSurfaceColorSpace); if (!newSurface) { return false; } -- cgit v1.2.3 From 8ddbc59d55881b1595f48facd6f91a4bd2d2453a Mon Sep 17 00:00:00 2001 From: John Reck Date: Thu, 7 May 2020 16:11:18 -0700 Subject: Avoid excessive KGSL maps Hook MIN_UNDEQUEUED_BUFFERS if possible to avoid thrashing kgsl maps when render_ahead is being used Bug: 143555869 Test: verified kgsl maps only happened once per buffer Change-Id: I985fae0a9a7635be3a1cf6177186e5541a1169df --- libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp') diff --git a/libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp b/libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp index 8d5acc631274..24a6228242a5 100644 --- a/libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp +++ b/libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp @@ -157,21 +157,7 @@ void SkiaOpenGLPipeline::onStop() { } } -static void setBufferCount(ANativeWindow* window, uint32_t extraBuffers) { - int query_value; - int err = window->query(window, NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS, &query_value); - if (err != 0 || query_value < 0) { - ALOGE("window->query failed: %s (%d) value=%d", strerror(-err), err, query_value); - return; - } - auto min_undequeued_buffers = static_cast(query_value); - - int bufferCount = min_undequeued_buffers + 2 + extraBuffers; - native_window_set_buffer_count(window, bufferCount); -} - -bool SkiaOpenGLPipeline::setSurface(ANativeWindow* surface, SwapBehavior swapBehavior, - uint32_t extraBuffers) { +bool SkiaOpenGLPipeline::setSurface(ANativeWindow* surface, SwapBehavior swapBehavior) { if (mEglSurface != EGL_NO_SURFACE) { mEglManager.destroySurface(mEglSurface); mEglSurface = EGL_NO_SURFACE; @@ -189,7 +175,6 @@ bool SkiaOpenGLPipeline::setSurface(ANativeWindow* surface, SwapBehavior swapBeh if (mEglSurface != EGL_NO_SURFACE) { const bool preserveBuffer = (swapBehavior != SwapBehavior::kSwap_discardBuffer); mBufferPreserved = mEglManager.setPreserveBuffer(mEglSurface, preserveBuffer); - setBufferCount(surface, extraBuffers); return true; } -- cgit v1.2.3