Add back alpha atrace log
bug:20922838 Change-Id: I70ccbffdd5f140cd1dd71fbf456fb5b085e74a4a
This commit is contained in:
@@ -392,6 +392,13 @@ void RenderNode::setViewProperties(OpenGLRenderer& renderer, T& handler) {
|
||||
}
|
||||
LOG_ALWAYS_FATAL_IF(!isLayer && properties().getHasOverlappingRendering());
|
||||
renderer.scaleAlpha(properties().getAlpha());
|
||||
|
||||
if (CC_UNLIKELY(ATRACE_ENABLED() && properties().promotedToLayer())) {
|
||||
// pretend to cause savelayer to warn about performance problem affecting old versions
|
||||
ATRACE_FORMAT("%s alpha caused saveLayer %dx%d", getName(),
|
||||
static_cast<int>(getWidth()),
|
||||
static_cast<int>(getHeight()));
|
||||
}
|
||||
}
|
||||
if (clipFlags) {
|
||||
Rect clipRect;
|
||||
|
||||
@@ -576,15 +576,15 @@ public:
|
||||
&& getOutline().getAlpha() != 0.0f;
|
||||
}
|
||||
|
||||
LayerType effectiveLayerType() const {
|
||||
LayerType type = mLayerProperties.mType;
|
||||
if (type == LayerType::None
|
||||
bool promotedToLayer() const {
|
||||
return mLayerProperties.mType == LayerType::None
|
||||
&& !MathUtils::isZero(mPrimitiveFields.mAlpha)
|
||||
&& mPrimitiveFields.mAlpha < 1
|
||||
&& mPrimitiveFields.mHasOverlappingRendering) {
|
||||
return LayerType::RenderLayer;
|
||||
}
|
||||
return type;
|
||||
&& mPrimitiveFields.mHasOverlappingRendering;
|
||||
}
|
||||
|
||||
LayerType effectiveLayerType() const {
|
||||
return promotedToLayer() ? LayerType::RenderLayer : mLayerProperties.mType;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
@@ -35,7 +35,7 @@ public:
|
||||
};
|
||||
|
||||
static void atraceFormatBegin(const char* fmt, ...) {
|
||||
if (CC_UNLIKELY(!ATRACE_ENABLED())) return;
|
||||
if (CC_LIKELY(!ATRACE_ENABLED())) return;
|
||||
|
||||
const int BUFFER_SIZE = 256;
|
||||
va_list ap;
|
||||
|
||||
Reference in New Issue
Block a user