Merge "Cleanup debug options" into lmp-mr1-dev automerge: b0aeaad
automerge: 49a01fc
* commit '49a01fc7dc8d2b9cc7591a94d19f3c209e470aea':
Cleanup debug options
This commit is contained in:
@ -255,6 +255,9 @@ public class ThreadedRenderer extends HardwareRenderer {
|
|||||||
mProfilingEnabled = wantProfiling;
|
mProfilingEnabled = wantProfiling;
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
|
if (changed) {
|
||||||
|
invalidateRoot();
|
||||||
|
}
|
||||||
return changed;
|
return changed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -525,7 +525,7 @@ void DeferredDisplayList::addDrawOp(OpenGLRenderer& renderer, DrawOp* op) {
|
|||||||
deferInfo.mergeable &= !recordingComplexClip();
|
deferInfo.mergeable &= !recordingComplexClip();
|
||||||
deferInfo.opaqueOverBounds &= !recordingComplexClip() && mSaveStack.isEmpty();
|
deferInfo.opaqueOverBounds &= !recordingComplexClip() && mSaveStack.isEmpty();
|
||||||
|
|
||||||
if (CC_LIKELY(mAvoidOverdraw) && mBatches.size() &&
|
if (mBatches.size() &&
|
||||||
state->mClipSideFlags != kClipSide_ConservativeFull &&
|
state->mClipSideFlags != kClipSide_ConservativeFull &&
|
||||||
deferInfo.opaqueOverBounds && state->mBounds.contains(mBounds)) {
|
deferInfo.opaqueOverBounds && state->mBounds.contains(mBounds)) {
|
||||||
// avoid overdraw by resetting drawing state + discarding drawing ops
|
// avoid overdraw by resetting drawing state + discarding drawing ops
|
||||||
@ -677,13 +677,12 @@ status_t DeferredDisplayList::flush(OpenGLRenderer& renderer, Rect& dirty) {
|
|||||||
DrawModifiers restoreDrawModifiers = renderer.getDrawModifiers();
|
DrawModifiers restoreDrawModifiers = renderer.getDrawModifiers();
|
||||||
renderer.save(SkCanvas::kMatrix_SaveFlag | SkCanvas::kClip_SaveFlag);
|
renderer.save(SkCanvas::kMatrix_SaveFlag | SkCanvas::kClip_SaveFlag);
|
||||||
|
|
||||||
if (CC_LIKELY(mAvoidOverdraw)) {
|
for (unsigned int i = 1; i < mBatches.size(); i++) {
|
||||||
for (unsigned int i = 1; i < mBatches.size(); i++) {
|
if (mBatches[i] && mBatches[i]->coversBounds(mBounds)) {
|
||||||
if (mBatches[i] && mBatches[i]->coversBounds(mBounds)) {
|
discardDrawingBatches(i - 1);
|
||||||
discardDrawingBatches(i - 1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// NOTE: depth of the save stack at this point, before playback, should be reflected in
|
// NOTE: depth of the save stack at this point, before playback, should be reflected in
|
||||||
// FLUSH_SAVE_STACK_DEPTH, so that save/restores match up correctly
|
// FLUSH_SAVE_STACK_DEPTH, so that save/restores match up correctly
|
||||||
status |= replayBatchList(mBatches, renderer, dirty);
|
status |= replayBatchList(mBatches, renderer, dirty);
|
||||||
|
@ -81,8 +81,8 @@ public:
|
|||||||
class DeferredDisplayList {
|
class DeferredDisplayList {
|
||||||
friend class DeferStateStruct; // used to give access to allocator
|
friend class DeferStateStruct; // used to give access to allocator
|
||||||
public:
|
public:
|
||||||
DeferredDisplayList(const Rect& bounds, bool avoidOverdraw = true) :
|
DeferredDisplayList(const Rect& bounds) :
|
||||||
mBounds(bounds), mAvoidOverdraw(avoidOverdraw) {
|
mBounds(bounds) {
|
||||||
clear();
|
clear();
|
||||||
}
|
}
|
||||||
~DeferredDisplayList() { clear(); }
|
~DeferredDisplayList() { clear(); }
|
||||||
@ -150,7 +150,6 @@ private:
|
|||||||
|
|
||||||
// layer space bounds of rendering
|
// layer space bounds of rendering
|
||||||
Rect mBounds;
|
Rect mBounds;
|
||||||
const bool mAvoidOverdraw;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* At defer time, stores the *defer time* savecount of save/saveLayer ops that were deferred, so
|
* At defer time, stores the *defer time* savecount of save/saveLayer ops that were deferred, so
|
||||||
|
@ -22,7 +22,8 @@
|
|||||||
|
|
||||||
#define DEFAULT_MAX_FRAMES 128
|
#define DEFAULT_MAX_FRAMES 128
|
||||||
|
|
||||||
#define RETURN_IF_DISABLED() if (CC_LIKELY(mType == kNone)) return
|
#define RETURN_IF_PROFILING_DISABLED() if (CC_LIKELY(mType == kNone)) return
|
||||||
|
#define RETURN_IF_DISABLED() if (CC_LIKELY(mType == kNone && !mShowDirtyRegions)) return
|
||||||
|
|
||||||
#define NANOS_TO_MILLIS_FLOAT(nanos) ((nanos) * 0.000001f)
|
#define NANOS_TO_MILLIS_FLOAT(nanos) ((nanos) * 0.000001f)
|
||||||
|
|
||||||
@ -64,7 +65,9 @@ DrawProfiler::DrawProfiler()
|
|||||||
, mPreviousTime(0)
|
, mPreviousTime(0)
|
||||||
, mVerticalUnit(0)
|
, mVerticalUnit(0)
|
||||||
, mHorizontalUnit(0)
|
, mHorizontalUnit(0)
|
||||||
, mThresholdStroke(0) {
|
, mThresholdStroke(0)
|
||||||
|
, mShowDirtyRegions(false)
|
||||||
|
, mFlashToggle(false) {
|
||||||
setDensity(1);
|
setDensity(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -82,27 +85,27 @@ void DrawProfiler::setDensity(float density) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void DrawProfiler::startFrame(nsecs_t recordDurationNanos) {
|
void DrawProfiler::startFrame(nsecs_t recordDurationNanos) {
|
||||||
RETURN_IF_DISABLED();
|
RETURN_IF_PROFILING_DISABLED();
|
||||||
mData[mCurrentFrame].record = NANOS_TO_MILLIS_FLOAT(recordDurationNanos);
|
mData[mCurrentFrame].record = NANOS_TO_MILLIS_FLOAT(recordDurationNanos);
|
||||||
mPreviousTime = systemTime(CLOCK_MONOTONIC);
|
mPreviousTime = systemTime(CLOCK_MONOTONIC);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrawProfiler::markPlaybackStart() {
|
void DrawProfiler::markPlaybackStart() {
|
||||||
RETURN_IF_DISABLED();
|
RETURN_IF_PROFILING_DISABLED();
|
||||||
nsecs_t now = systemTime(CLOCK_MONOTONIC);
|
nsecs_t now = systemTime(CLOCK_MONOTONIC);
|
||||||
mData[mCurrentFrame].prepare = NANOS_TO_MILLIS_FLOAT(now - mPreviousTime);
|
mData[mCurrentFrame].prepare = NANOS_TO_MILLIS_FLOAT(now - mPreviousTime);
|
||||||
mPreviousTime = now;
|
mPreviousTime = now;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrawProfiler::markPlaybackEnd() {
|
void DrawProfiler::markPlaybackEnd() {
|
||||||
RETURN_IF_DISABLED();
|
RETURN_IF_PROFILING_DISABLED();
|
||||||
nsecs_t now = systemTime(CLOCK_MONOTONIC);
|
nsecs_t now = systemTime(CLOCK_MONOTONIC);
|
||||||
mData[mCurrentFrame].playback = NANOS_TO_MILLIS_FLOAT(now - mPreviousTime);
|
mData[mCurrentFrame].playback = NANOS_TO_MILLIS_FLOAT(now - mPreviousTime);
|
||||||
mPreviousTime = now;
|
mPreviousTime = now;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrawProfiler::finishFrame() {
|
void DrawProfiler::finishFrame() {
|
||||||
RETURN_IF_DISABLED();
|
RETURN_IF_PROFILING_DISABLED();
|
||||||
nsecs_t now = systemTime(CLOCK_MONOTONIC);
|
nsecs_t now = systemTime(CLOCK_MONOTONIC);
|
||||||
mData[mCurrentFrame].swapBuffers = NANOS_TO_MILLIS_FLOAT(now - mPreviousTime);
|
mData[mCurrentFrame].swapBuffers = NANOS_TO_MILLIS_FLOAT(now - mPreviousTime);
|
||||||
mPreviousTime = now;
|
mPreviousTime = now;
|
||||||
@ -114,19 +117,30 @@ void DrawProfiler::unionDirty(SkRect* dirty) {
|
|||||||
// Not worth worrying about minimizing the dirty region for debugging, so just
|
// Not worth worrying about minimizing the dirty region for debugging, so just
|
||||||
// dirty the entire viewport.
|
// dirty the entire viewport.
|
||||||
if (dirty) {
|
if (dirty) {
|
||||||
|
mDirtyRegion = *dirty;
|
||||||
dirty->setEmpty();
|
dirty->setEmpty();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrawProfiler::draw(OpenGLRenderer* canvas) {
|
void DrawProfiler::draw(OpenGLRenderer* canvas) {
|
||||||
if (CC_LIKELY(mType != kBars)) {
|
RETURN_IF_DISABLED();
|
||||||
return;
|
|
||||||
|
if (mShowDirtyRegions) {
|
||||||
|
mFlashToggle = !mFlashToggle;
|
||||||
|
if (mFlashToggle) {
|
||||||
|
SkPaint paint;
|
||||||
|
paint.setColor(0x7fff0000);
|
||||||
|
canvas->drawRect(mDirtyRegion.fLeft, mDirtyRegion.fTop,
|
||||||
|
mDirtyRegion.fRight, mDirtyRegion.fBottom, &paint);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
prepareShapes(canvas->getViewportHeight());
|
if (mType == kBars) {
|
||||||
drawGraph(canvas);
|
prepareShapes(canvas->getViewportHeight());
|
||||||
drawCurrentFrame(canvas);
|
drawGraph(canvas);
|
||||||
drawThreshold(canvas);
|
drawCurrentFrame(canvas);
|
||||||
|
drawThreshold(canvas);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrawProfiler::createData() {
|
void DrawProfiler::createData() {
|
||||||
@ -217,6 +231,7 @@ DrawProfiler::ProfileType DrawProfiler::loadRequestedProfileType() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool DrawProfiler::loadSystemProperties() {
|
bool DrawProfiler::loadSystemProperties() {
|
||||||
|
bool changed = false;
|
||||||
ProfileType newType = loadRequestedProfileType();
|
ProfileType newType = loadRequestedProfileType();
|
||||||
if (newType != mType) {
|
if (newType != mType) {
|
||||||
mType = newType;
|
mType = newType;
|
||||||
@ -225,13 +240,18 @@ bool DrawProfiler::loadSystemProperties() {
|
|||||||
} else {
|
} else {
|
||||||
createData();
|
createData();
|
||||||
}
|
}
|
||||||
return true;
|
changed = true;
|
||||||
}
|
}
|
||||||
return false;
|
bool showDirty = property_get_bool(PROPERTY_DEBUG_SHOW_DIRTY_REGIONS, false);
|
||||||
|
if (showDirty != mShowDirtyRegions) {
|
||||||
|
mShowDirtyRegions = showDirty;
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
return changed;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrawProfiler::dumpData(int fd) {
|
void DrawProfiler::dumpData(int fd) {
|
||||||
RETURN_IF_DISABLED();
|
RETURN_IF_PROFILING_DISABLED();
|
||||||
|
|
||||||
// This method logs the last N frames (where N is <= mDataSize) since the
|
// This method logs the last N frames (where N is <= mDataSize) since the
|
||||||
// last call to dumpData(). In other words if there's a dumpData(), draw frame,
|
// last call to dumpData(). In other words if there's a dumpData(), draw frame,
|
||||||
|
@ -88,6 +88,10 @@ private:
|
|||||||
* information.
|
* information.
|
||||||
*/
|
*/
|
||||||
float** mRects;
|
float** mRects;
|
||||||
|
|
||||||
|
bool mShowDirtyRegions;
|
||||||
|
SkRect mDirtyRegion;
|
||||||
|
bool mFlashToggle;
|
||||||
};
|
};
|
||||||
|
|
||||||
} /* namespace uirenderer */
|
} /* namespace uirenderer */
|
||||||
|
@ -151,7 +151,6 @@ OpenGLRenderer::OpenGLRenderer(RenderState& renderState)
|
|||||||
, mScissorOptimizationDisabled(false)
|
, mScissorOptimizationDisabled(false)
|
||||||
, mSuppressTiling(false)
|
, mSuppressTiling(false)
|
||||||
, mFirstFrameAfterResize(true)
|
, mFirstFrameAfterResize(true)
|
||||||
, mCountOverdraw(false)
|
|
||||||
, mLightCenter((Vector3){FLT_MIN, FLT_MIN, FLT_MIN})
|
, mLightCenter((Vector3){FLT_MIN, FLT_MIN, FLT_MIN})
|
||||||
, mLightRadius(FLT_MIN)
|
, mLightRadius(FLT_MIN)
|
||||||
, mAmbientShadowAlpha(0)
|
, mAmbientShadowAlpha(0)
|
||||||
@ -266,7 +265,7 @@ void OpenGLRenderer::discardFramebuffer(float left, float top, float right, floa
|
|||||||
}
|
}
|
||||||
|
|
||||||
status_t OpenGLRenderer::clear(float left, float top, float right, float bottom, bool opaque) {
|
status_t OpenGLRenderer::clear(float left, float top, float right, float bottom, bool opaque) {
|
||||||
if (!opaque || mCountOverdraw) {
|
if (!opaque) {
|
||||||
mCaches.enableScissor();
|
mCaches.enableScissor();
|
||||||
mCaches.setScissor(left, getViewportHeight() - bottom, right - left, bottom - top);
|
mCaches.setScissor(left, getViewportHeight() - bottom, right - left, bottom - top);
|
||||||
glClear(GL_COLOR_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT);
|
||||||
@ -347,10 +346,6 @@ void OpenGLRenderer::finish() {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mCountOverdraw) {
|
|
||||||
countOverdraw();
|
|
||||||
}
|
|
||||||
|
|
||||||
mFrameStarted = false;
|
mFrameStarted = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -464,21 +459,6 @@ void OpenGLRenderer::renderOverdraw() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpenGLRenderer::countOverdraw() {
|
|
||||||
size_t count = getWidth() * getHeight();
|
|
||||||
uint32_t* buffer = new uint32_t[count];
|
|
||||||
glReadPixels(0, 0, getWidth(), getHeight(), GL_RGBA, GL_UNSIGNED_BYTE, &buffer[0]);
|
|
||||||
|
|
||||||
size_t total = 0;
|
|
||||||
for (size_t i = 0; i < count; i++) {
|
|
||||||
total += buffer[i] & 0xff;
|
|
||||||
}
|
|
||||||
|
|
||||||
mOverdraw = total / float(count);
|
|
||||||
|
|
||||||
delete[] buffer;
|
|
||||||
}
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
// Layers
|
// Layers
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
@ -1647,8 +1627,6 @@ void OpenGLRenderer::setupDraw(bool clearLayer) {
|
|||||||
mDescription.hasDebugHighlight = !mCaches.debugOverdraw &&
|
mDescription.hasDebugHighlight = !mCaches.debugOverdraw &&
|
||||||
mCaches.debugStencilClip == Caches::kStencilShowHighlight &&
|
mCaches.debugStencilClip == Caches::kStencilShowHighlight &&
|
||||||
mCaches.stencil.isTestEnabled();
|
mCaches.stencil.isTestEnabled();
|
||||||
|
|
||||||
mDescription.emulateStencil = mCountOverdraw;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpenGLRenderer::setupDrawWithTexture(bool isAlpha8) {
|
void OpenGLRenderer::setupDrawWithTexture(bool isAlpha8) {
|
||||||
@ -1980,8 +1958,7 @@ status_t OpenGLRenderer::drawRenderNode(RenderNode* renderNode, Rect& dirty, int
|
|||||||
return status | replayStruct.mDrawGlStatus;
|
return status | replayStruct.mDrawGlStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool avoidOverdraw = !mCaches.debugOverdraw && !mCountOverdraw; // shh, don't tell devs!
|
DeferredDisplayList deferredList(*currentClipRect());
|
||||||
DeferredDisplayList deferredList(*currentClipRect(), avoidOverdraw);
|
|
||||||
DeferStateStruct deferStruct(deferredList, *this, replayFlags);
|
DeferStateStruct deferStruct(deferredList, *this, replayFlags);
|
||||||
renderNode->defer(deferStruct, 0);
|
renderNode->defer(deferStruct, 0);
|
||||||
|
|
||||||
@ -3453,19 +3430,6 @@ void OpenGLRenderer::chooseBlending(bool blend, SkXfermode::Mode mode,
|
|||||||
}
|
}
|
||||||
mSkipOutlineClip = true;
|
mSkipOutlineClip = true;
|
||||||
|
|
||||||
if (mCountOverdraw) {
|
|
||||||
if (!mCaches.blend) glEnable(GL_BLEND);
|
|
||||||
if (mCaches.lastSrcMode != GL_ONE || mCaches.lastDstMode != GL_ONE) {
|
|
||||||
glBlendFunc(GL_ONE, GL_ONE);
|
|
||||||
}
|
|
||||||
|
|
||||||
mCaches.blend = true;
|
|
||||||
mCaches.lastSrcMode = GL_ONE;
|
|
||||||
mCaches.lastDstMode = GL_ONE;
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
blend = blend || mode != SkXfermode::kSrcOver_Mode;
|
blend = blend || mode != SkXfermode::kSrcOver_Mode;
|
||||||
|
|
||||||
if (blend) {
|
if (blend) {
|
||||||
|
@ -136,14 +136,6 @@ public:
|
|||||||
virtual status_t prepareDirty(float left, float top, float right, float bottom, bool opaque);
|
virtual status_t prepareDirty(float left, float top, float right, float bottom, bool opaque);
|
||||||
virtual void finish();
|
virtual void finish();
|
||||||
|
|
||||||
void setCountOverdrawEnabled(bool enabled) {
|
|
||||||
mCountOverdraw = enabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
float getOverdraw() {
|
|
||||||
return mCountOverdraw ? mOverdraw : 0.0f;
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual status_t callDrawGLFunction(Functor* functor, Rect& dirty);
|
virtual status_t callDrawGLFunction(Functor* functor, Rect& dirty);
|
||||||
|
|
||||||
void pushLayerUpdate(Layer* layer);
|
void pushLayerUpdate(Layer* layer);
|
||||||
@ -1015,11 +1007,6 @@ private:
|
|||||||
bool mSuppressTiling;
|
bool mSuppressTiling;
|
||||||
bool mFirstFrameAfterResize;
|
bool mFirstFrameAfterResize;
|
||||||
|
|
||||||
// If true, this renderer will setup drawing to emulate
|
|
||||||
// an increment stencil buffer in the color buffer
|
|
||||||
bool mCountOverdraw;
|
|
||||||
float mOverdraw;
|
|
||||||
|
|
||||||
bool mSkipOutlineClip;
|
bool mSkipOutlineClip;
|
||||||
|
|
||||||
// Lighting + shadows
|
// Lighting + shadows
|
||||||
|
@ -84,8 +84,7 @@ namespace uirenderer {
|
|||||||
#define PROGRAM_HAS_COLORS 42
|
#define PROGRAM_HAS_COLORS 42
|
||||||
|
|
||||||
#define PROGRAM_HAS_DEBUG_HIGHLIGHT 43
|
#define PROGRAM_HAS_DEBUG_HIGHLIGHT 43
|
||||||
#define PROGRAM_EMULATE_STENCIL 44
|
#define PROGRAM_HAS_ROUND_RECT_CLIP 44
|
||||||
#define PROGRAM_HAS_ROUND_RECT_CLIP 45
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
// Types
|
// Types
|
||||||
@ -161,7 +160,6 @@ struct ProgramDescription {
|
|||||||
float gamma;
|
float gamma;
|
||||||
|
|
||||||
bool hasDebugHighlight;
|
bool hasDebugHighlight;
|
||||||
bool emulateStencil;
|
|
||||||
bool hasRoundRectClip;
|
bool hasRoundRectClip;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -204,7 +202,6 @@ struct ProgramDescription {
|
|||||||
gamma = 2.2f;
|
gamma = 2.2f;
|
||||||
|
|
||||||
hasDebugHighlight = false;
|
hasDebugHighlight = false;
|
||||||
emulateStencil = false;
|
|
||||||
hasRoundRectClip = false;
|
hasRoundRectClip = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -272,7 +269,6 @@ struct ProgramDescription {
|
|||||||
if (isSimpleGradient) key |= programid(0x1) << PROGRAM_IS_SIMPLE_GRADIENT;
|
if (isSimpleGradient) key |= programid(0x1) << PROGRAM_IS_SIMPLE_GRADIENT;
|
||||||
if (hasColors) key |= programid(0x1) << PROGRAM_HAS_COLORS;
|
if (hasColors) key |= programid(0x1) << PROGRAM_HAS_COLORS;
|
||||||
if (hasDebugHighlight) key |= programid(0x1) << PROGRAM_HAS_DEBUG_HIGHLIGHT;
|
if (hasDebugHighlight) key |= programid(0x1) << PROGRAM_HAS_DEBUG_HIGHLIGHT;
|
||||||
if (emulateStencil) key |= programid(0x1) << PROGRAM_EMULATE_STENCIL;
|
|
||||||
if (hasRoundRectClip) key |= programid(0x1) << PROGRAM_HAS_ROUND_RECT_CLIP;
|
if (hasRoundRectClip) key |= programid(0x1) << PROGRAM_HAS_ROUND_RECT_CLIP;
|
||||||
return key;
|
return key;
|
||||||
}
|
}
|
||||||
|
@ -347,12 +347,6 @@ const char* gFS_Main_FragColor_HasRoundRectClip =
|
|||||||
|
|
||||||
const char* gFS_Main_DebugHighlight =
|
const char* gFS_Main_DebugHighlight =
|
||||||
" gl_FragColor.rgb = vec3(0.0, gl_FragColor.a, 0.0);\n";
|
" gl_FragColor.rgb = vec3(0.0, gl_FragColor.a, 0.0);\n";
|
||||||
const char* gFS_Main_EmulateStencil =
|
|
||||||
" gl_FragColor.rgba = vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 1.0);\n"
|
|
||||||
" return;\n"
|
|
||||||
" /*\n";
|
|
||||||
const char* gFS_Footer_EmulateStencil =
|
|
||||||
" */\n";
|
|
||||||
const char* gFS_Footer =
|
const char* gFS_Footer =
|
||||||
"}\n\n";
|
"}\n\n";
|
||||||
|
|
||||||
@ -617,7 +611,6 @@ String8 ProgramCache::generateFragmentShader(const ProgramDescription& descripti
|
|||||||
&& !description.hasColors
|
&& !description.hasColors
|
||||||
&& description.colorOp == ProgramDescription::kColorNone
|
&& description.colorOp == ProgramDescription::kColorNone
|
||||||
&& !description.hasDebugHighlight
|
&& !description.hasDebugHighlight
|
||||||
&& !description.emulateStencil
|
|
||||||
&& !description.hasRoundRectClip) {
|
&& !description.hasRoundRectClip) {
|
||||||
bool fast = false;
|
bool fast = false;
|
||||||
|
|
||||||
@ -698,9 +691,6 @@ String8 ProgramCache::generateFragmentShader(const ProgramDescription& descripti
|
|||||||
|
|
||||||
// Begin the shader
|
// Begin the shader
|
||||||
shader.append(gFS_Main); {
|
shader.append(gFS_Main); {
|
||||||
if (description.emulateStencil) {
|
|
||||||
shader.append(gFS_Main_EmulateStencil);
|
|
||||||
}
|
|
||||||
// Stores the result in fragColor directly
|
// Stores the result in fragColor directly
|
||||||
if (description.hasTexture || description.hasExternalTexture) {
|
if (description.hasTexture || description.hasExternalTexture) {
|
||||||
if (description.hasAlpha8Texture) {
|
if (description.hasAlpha8Texture) {
|
||||||
@ -779,9 +769,6 @@ String8 ProgramCache::generateFragmentShader(const ProgramDescription& descripti
|
|||||||
shader.append(gFS_Main_DebugHighlight);
|
shader.append(gFS_Main_DebugHighlight);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (description.emulateStencil) {
|
|
||||||
shader.append(gFS_Footer_EmulateStencil);
|
|
||||||
}
|
|
||||||
// End the shader
|
// End the shader
|
||||||
shader.append(gFS_Footer);
|
shader.append(gFS_Footer);
|
||||||
|
|
||||||
|
@ -132,6 +132,15 @@ enum DebugLevel {
|
|||||||
*/
|
*/
|
||||||
#define PROPERTY_DEBUG_STENCIL_CLIP "debug.hwui.show_non_rect_clip"
|
#define PROPERTY_DEBUG_STENCIL_CLIP "debug.hwui.show_non_rect_clip"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Turn on to draw dirty regions every other frame.
|
||||||
|
*
|
||||||
|
* Possible values:
|
||||||
|
* "true", to enable dirty regions debugging
|
||||||
|
* "false", to disable dirty regions debugging
|
||||||
|
*/
|
||||||
|
#define PROPERTY_DEBUG_SHOW_DIRTY_REGIONS "debug.hwui.show_dirty_regions"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Disables draw operation deferral if set to "true", forcing draw
|
* Disables draw operation deferral if set to "true", forcing draw
|
||||||
* commands to be issued to OpenGL in order, and processed in sequence
|
* commands to be issued to OpenGL in order, and processed in sequence
|
||||||
|
Reference in New Issue
Block a user