Loading libs/renderengine/include/renderengine/LayerSettings.h +3 −0 Original line number Diff line number Diff line Loading @@ -154,6 +154,9 @@ struct LayerSettings { int backgroundBlurRadius = 0; std::vector<BlurRegion> blurRegions; // Name associated with the layer for debugging purposes. std::string name; }; // Keep in sync with custom comparison function in Loading libs/renderengine/skia/SkiaGLRenderEngine.cpp +22 −0 Original line number Diff line number Diff line Loading @@ -477,10 +477,23 @@ status_t SkiaGLRenderEngine::drawLayers(const DisplaySettings& display, mGrContext.get()); SkCanvas* canvas = mCapture.tryCapture(surface.get()); if (canvas == nullptr) { ALOGE("Cannot acquire canvas from Skia."); return BAD_VALUE; } // Clear the entire canvas with a transparent black to prevent ghost images. canvas->clear(SK_ColorTRANSPARENT); canvas->save(); if (mCapture.isCaptureRunning()) { // Record display settings when capture is running. std::stringstream displaySettings; PrintTo(display, &displaySettings); // Store the DisplaySettings in additional information. canvas->drawAnnotation(SkRect::MakeEmpty(), "DisplaySettings", SkData::MakeWithCString(displaySettings.str().c_str())); } // Before doing any drawing, let's make sure that we'll start at the origin of the display. // Some displays don't start at 0,0 for example when we're mirroring the screen. Also, virtual // displays might have different scaling when compared to the physical screen. Loading Loading @@ -511,6 +524,15 @@ status_t SkiaGLRenderEngine::drawLayers(const DisplaySettings& display, for (const auto& layer : layers) { canvas->save(); if (mCapture.isCaptureRunning()) { // Record the name of the layer if the capture is running. std::stringstream layerSettings; PrintTo(*layer, &layerSettings); // Store the LayerSettings in additional information. canvas->drawAnnotation(SkRect::MakeEmpty(), layer->name.c_str(), SkData::MakeWithCString(layerSettings.str().c_str())); } // Layers have a local transform that should be applied to them canvas->concat(getSkM44(layer->geometry.positionTransform).asM33()); Loading libs/renderengine/skia/debug/SkiaCapture.h +2 −0 Original line number Diff line number Diff line Loading @@ -45,6 +45,8 @@ public: SkCanvas* tryCapture(SkSurface* surface); // Called at the end of every frame. void endCapture(); // Returns whether the capture is running. bool isCaptureRunning() { return mCaptureRunning; } private: // Performs the first-frame work of a multi frame SKP capture. Returns true if successful. Loading services/surfaceflinger/Layer.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -656,6 +656,8 @@ std::optional<compositionengine::LayerFE::LayerSettings> Layer::prepareClientCom layerSettings.backgroundBlurRadius = getBackgroundBlurRadius(); layerSettings.blurRegions = getBlurRegions(); } // Record the name of the layer for debugging further down the stack. layerSettings.name = getName(); return layerSettings; } Loading Loading
libs/renderengine/include/renderengine/LayerSettings.h +3 −0 Original line number Diff line number Diff line Loading @@ -154,6 +154,9 @@ struct LayerSettings { int backgroundBlurRadius = 0; std::vector<BlurRegion> blurRegions; // Name associated with the layer for debugging purposes. std::string name; }; // Keep in sync with custom comparison function in Loading
libs/renderengine/skia/SkiaGLRenderEngine.cpp +22 −0 Original line number Diff line number Diff line Loading @@ -477,10 +477,23 @@ status_t SkiaGLRenderEngine::drawLayers(const DisplaySettings& display, mGrContext.get()); SkCanvas* canvas = mCapture.tryCapture(surface.get()); if (canvas == nullptr) { ALOGE("Cannot acquire canvas from Skia."); return BAD_VALUE; } // Clear the entire canvas with a transparent black to prevent ghost images. canvas->clear(SK_ColorTRANSPARENT); canvas->save(); if (mCapture.isCaptureRunning()) { // Record display settings when capture is running. std::stringstream displaySettings; PrintTo(display, &displaySettings); // Store the DisplaySettings in additional information. canvas->drawAnnotation(SkRect::MakeEmpty(), "DisplaySettings", SkData::MakeWithCString(displaySettings.str().c_str())); } // Before doing any drawing, let's make sure that we'll start at the origin of the display. // Some displays don't start at 0,0 for example when we're mirroring the screen. Also, virtual // displays might have different scaling when compared to the physical screen. Loading Loading @@ -511,6 +524,15 @@ status_t SkiaGLRenderEngine::drawLayers(const DisplaySettings& display, for (const auto& layer : layers) { canvas->save(); if (mCapture.isCaptureRunning()) { // Record the name of the layer if the capture is running. std::stringstream layerSettings; PrintTo(*layer, &layerSettings); // Store the LayerSettings in additional information. canvas->drawAnnotation(SkRect::MakeEmpty(), layer->name.c_str(), SkData::MakeWithCString(layerSettings.str().c_str())); } // Layers have a local transform that should be applied to them canvas->concat(getSkM44(layer->geometry.positionTransform).asM33()); Loading
libs/renderengine/skia/debug/SkiaCapture.h +2 −0 Original line number Diff line number Diff line Loading @@ -45,6 +45,8 @@ public: SkCanvas* tryCapture(SkSurface* surface); // Called at the end of every frame. void endCapture(); // Returns whether the capture is running. bool isCaptureRunning() { return mCaptureRunning; } private: // Performs the first-frame work of a multi frame SKP capture. Returns true if successful. Loading
services/surfaceflinger/Layer.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -656,6 +656,8 @@ std::optional<compositionengine::LayerFE::LayerSettings> Layer::prepareClientCom layerSettings.backgroundBlurRadius = getBackgroundBlurRadius(); layerSettings.blurRegions = getBlurRegions(); } // Record the name of the layer for debugging further down the stack. layerSettings.name = getName(); return layerSettings; } Loading