Loading libs/hwui/RenderNode.cpp +1 −14 Original line number Diff line number Diff line Loading @@ -243,24 +243,11 @@ void RenderNode::pushLayerUpdate(TreeInfo& info) { return; } if (info.canvasContext.createOrUpdateLayer(this, *info.damageAccumulator)) { if (info.canvasContext.createOrUpdateLayer(this, *info.damageAccumulator, info.errorHandler)) { damageSelf(info); } if (!hasLayer()) { Caches::getInstance().dumpMemoryUsage(); if (info.errorHandler) { std::ostringstream err; err << "Unable to create layer for " << getName(); const int maxTextureSize = Caches::getInstance().maxTextureSize; if (getWidth() > maxTextureSize || getHeight() > maxTextureSize) { err << ", size " << getWidth() << "x" << getHeight() << " exceeds max size " << maxTextureSize; } else { err << ", see logcat for more info"; } info.errorHandler->onError(err.str()); } return; } Loading libs/hwui/pipeline/skia/SkiaPipeline.cpp +16 −1 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ #include <SkOverdrawColorFilter.h> #include <SkPicture.h> #include <SkPictureRecorder.h> #include "TreeInfo.h" #include "VectorDrawable.h" #include "utils/TraceUtils.h" Loading Loading @@ -158,7 +159,7 @@ void SkiaPipeline::renderLayersImpl(const LayerUpdateQueue& layers, bool opaque, } bool SkiaPipeline::createOrUpdateLayer(RenderNode* node, const DamageAccumulator& damageAccumulator, bool wideColorGamut) { bool wideColorGamut, ErrorHandler* errorHandler) { // compute the size of the surface (i.e. texture) to be allocated for this layer const int surfaceWidth = ceilf(node->getWidth() / float(LAYER_SIZE)) * LAYER_SIZE; const int surfaceHeight = ceilf(node->getHeight() / float(LAYER_SIZE)) * LAYER_SIZE; Loading @@ -182,6 +183,20 @@ bool SkiaPipeline::createOrUpdateLayer(RenderNode* node, const DamageAccumulator Matrix4 windowTransform; damageAccumulator.computeCurrentTransform(&windowTransform); node->getSkiaLayer()->inverseTransformInWindow = windowTransform; } else { String8 cachesOutput; mRenderThread.cacheManager().dumpMemoryUsage(cachesOutput, &mRenderThread.renderState()); ALOGE("%s", cachesOutput.string()); if (errorHandler) { std::ostringstream err; err << "Unable to create layer for " << node->getName(); const int maxTextureSize = DeviceInfo::get()->maxTextureSize(); err << ", size " << info.width() << "x" << info.height() << " max size " << maxTextureSize << " color type " << (int)info.colorType() << " has context " << (int)(mRenderThread.getGrContext() != nullptr); errorHandler->onError(err.str()); } } return true; } Loading libs/hwui/pipeline/skia/SkiaPipeline.h +1 −1 Original line number Diff line number Diff line Loading @@ -47,7 +47,7 @@ public: const BakedOpRenderer::LightInfo& lightInfo) override; bool createOrUpdateLayer(RenderNode* node, const DamageAccumulator& damageAccumulator, bool wideColorGamut) override; bool wideColorGamut, ErrorHandler* errorHandler) override; void renderFrame(const LayerUpdateQueue& layers, const SkRect& clip, const std::vector<sp<RenderNode>>& nodes, bool opaque, bool wideColorGamut, Loading libs/hwui/renderthread/CanvasContext.h +5 −2 Original line number Diff line number Diff line Loading @@ -49,6 +49,7 @@ namespace uirenderer { class AnimationContext; class DeferredLayerUpdater; class ErrorHandler; class Layer; class Rect; class RenderState; Loading @@ -74,8 +75,10 @@ public: * * @return true if the layer has been created or updated */ bool createOrUpdateLayer(RenderNode* node, const DamageAccumulator& dmgAccumulator) { return mRenderPipeline->createOrUpdateLayer(node, dmgAccumulator, mWideColorGamut); bool createOrUpdateLayer(RenderNode* node, const DamageAccumulator& dmgAccumulator, ErrorHandler* errorHandler) { return mRenderPipeline->createOrUpdateLayer(node, dmgAccumulator, mWideColorGamut, errorHandler); } /** Loading libs/hwui/renderthread/IRenderPipeline.h +2 −1 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ class Surface; namespace uirenderer { class DeferredLayerUpdater; class ErrorHandler; namespace renderthread { Loading Loading @@ -68,7 +69,7 @@ public: const BakedOpRenderer::LightInfo& lightInfo) = 0; virtual TaskManager* getTaskManager() = 0; virtual bool createOrUpdateLayer(RenderNode* node, const DamageAccumulator& damageAccumulator, bool wideColorGamut) = 0; bool wideColorGamut, ErrorHandler* errorHandler) = 0; virtual bool pinImages(std::vector<SkImage*>& mutableImages) = 0; virtual bool pinImages(LsaVector<sk_sp<Bitmap>>& images) = 0; virtual void unpinImages() = 0; Loading Loading
libs/hwui/RenderNode.cpp +1 −14 Original line number Diff line number Diff line Loading @@ -243,24 +243,11 @@ void RenderNode::pushLayerUpdate(TreeInfo& info) { return; } if (info.canvasContext.createOrUpdateLayer(this, *info.damageAccumulator)) { if (info.canvasContext.createOrUpdateLayer(this, *info.damageAccumulator, info.errorHandler)) { damageSelf(info); } if (!hasLayer()) { Caches::getInstance().dumpMemoryUsage(); if (info.errorHandler) { std::ostringstream err; err << "Unable to create layer for " << getName(); const int maxTextureSize = Caches::getInstance().maxTextureSize; if (getWidth() > maxTextureSize || getHeight() > maxTextureSize) { err << ", size " << getWidth() << "x" << getHeight() << " exceeds max size " << maxTextureSize; } else { err << ", see logcat for more info"; } info.errorHandler->onError(err.str()); } return; } Loading
libs/hwui/pipeline/skia/SkiaPipeline.cpp +16 −1 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ #include <SkOverdrawColorFilter.h> #include <SkPicture.h> #include <SkPictureRecorder.h> #include "TreeInfo.h" #include "VectorDrawable.h" #include "utils/TraceUtils.h" Loading Loading @@ -158,7 +159,7 @@ void SkiaPipeline::renderLayersImpl(const LayerUpdateQueue& layers, bool opaque, } bool SkiaPipeline::createOrUpdateLayer(RenderNode* node, const DamageAccumulator& damageAccumulator, bool wideColorGamut) { bool wideColorGamut, ErrorHandler* errorHandler) { // compute the size of the surface (i.e. texture) to be allocated for this layer const int surfaceWidth = ceilf(node->getWidth() / float(LAYER_SIZE)) * LAYER_SIZE; const int surfaceHeight = ceilf(node->getHeight() / float(LAYER_SIZE)) * LAYER_SIZE; Loading @@ -182,6 +183,20 @@ bool SkiaPipeline::createOrUpdateLayer(RenderNode* node, const DamageAccumulator Matrix4 windowTransform; damageAccumulator.computeCurrentTransform(&windowTransform); node->getSkiaLayer()->inverseTransformInWindow = windowTransform; } else { String8 cachesOutput; mRenderThread.cacheManager().dumpMemoryUsage(cachesOutput, &mRenderThread.renderState()); ALOGE("%s", cachesOutput.string()); if (errorHandler) { std::ostringstream err; err << "Unable to create layer for " << node->getName(); const int maxTextureSize = DeviceInfo::get()->maxTextureSize(); err << ", size " << info.width() << "x" << info.height() << " max size " << maxTextureSize << " color type " << (int)info.colorType() << " has context " << (int)(mRenderThread.getGrContext() != nullptr); errorHandler->onError(err.str()); } } return true; } Loading
libs/hwui/pipeline/skia/SkiaPipeline.h +1 −1 Original line number Diff line number Diff line Loading @@ -47,7 +47,7 @@ public: const BakedOpRenderer::LightInfo& lightInfo) override; bool createOrUpdateLayer(RenderNode* node, const DamageAccumulator& damageAccumulator, bool wideColorGamut) override; bool wideColorGamut, ErrorHandler* errorHandler) override; void renderFrame(const LayerUpdateQueue& layers, const SkRect& clip, const std::vector<sp<RenderNode>>& nodes, bool opaque, bool wideColorGamut, Loading
libs/hwui/renderthread/CanvasContext.h +5 −2 Original line number Diff line number Diff line Loading @@ -49,6 +49,7 @@ namespace uirenderer { class AnimationContext; class DeferredLayerUpdater; class ErrorHandler; class Layer; class Rect; class RenderState; Loading @@ -74,8 +75,10 @@ public: * * @return true if the layer has been created or updated */ bool createOrUpdateLayer(RenderNode* node, const DamageAccumulator& dmgAccumulator) { return mRenderPipeline->createOrUpdateLayer(node, dmgAccumulator, mWideColorGamut); bool createOrUpdateLayer(RenderNode* node, const DamageAccumulator& dmgAccumulator, ErrorHandler* errorHandler) { return mRenderPipeline->createOrUpdateLayer(node, dmgAccumulator, mWideColorGamut, errorHandler); } /** Loading
libs/hwui/renderthread/IRenderPipeline.h +2 −1 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ class Surface; namespace uirenderer { class DeferredLayerUpdater; class ErrorHandler; namespace renderthread { Loading Loading @@ -68,7 +69,7 @@ public: const BakedOpRenderer::LightInfo& lightInfo) = 0; virtual TaskManager* getTaskManager() = 0; virtual bool createOrUpdateLayer(RenderNode* node, const DamageAccumulator& damageAccumulator, bool wideColorGamut) = 0; bool wideColorGamut, ErrorHandler* errorHandler) = 0; virtual bool pinImages(std::vector<SkImage*>& mutableImages) = 0; virtual bool pinImages(LsaVector<sk_sp<Bitmap>>& images) = 0; virtual void unpinImages() = 0; Loading