summaryrefslogtreecommitdiffstats
path: root/libs/hwui/DisplayListOp.h
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2014-07-17 12:25:11 -0700
committerChris Craik <ccraik@google.com>2014-07-17 12:25:11 -0700
commit98d608dba6a0b3c15fb08f1fa2c8b9d170124c7c (patch)
treecba2372b4abff4dae433df57662e7a7a27611ff2 /libs/hwui/DisplayListOp.h
parent889fc94ffa70633e510e812b9da86723f4eee384 (diff)
downloadframeworks_base-98d608dba6a0b3c15fb08f1fa2c8b9d170124c7c.zip
frameworks_base-98d608dba6a0b3c15fb08f1fa2c8b9d170124c7c.tar.gz
frameworks_base-98d608dba6a0b3c15fb08f1fa2c8b9d170124c7c.tar.bz2
Minor cleanups around color usage
Change-Id: I56733cbe933a58d5977c032f056abb35265ee252
Diffstat (limited to 'libs/hwui/DisplayListOp.h')
-rw-r--r--libs/hwui/DisplayListOp.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/libs/hwui/DisplayListOp.h b/libs/hwui/DisplayListOp.h
index 75d52b4..9f66904 100644
--- a/libs/hwui/DisplayListOp.h
+++ b/libs/hwui/DisplayListOp.h
@@ -21,6 +21,7 @@
#define LOG_TAG "OpenGLRenderer"
#endif
+#include <SkColor.h>
#include <SkPath.h>
#include <SkPathOps.h>
#include <SkXfermode.h>
@@ -1315,7 +1316,7 @@ public:
FontRenderer& fontRenderer = renderer.getCaches().fontRenderer->getFontRenderer(paint);
fontRenderer.precache(paint, mText, mCount, SkMatrix::I());
- deferInfo.batchId = mPaint->getColor() == 0xff000000 ?
+ deferInfo.batchId = mPaint->getColor() == SK_ColorBLACK ?
DeferredDisplayList::kOpBatch_Text :
DeferredDisplayList::kOpBatch_ColorText;
}
@@ -1385,17 +1386,19 @@ public:
fontRenderer.precache(paint, mText, mCount, transform);
mPrecacheTransform = transform;
}
- deferInfo.batchId = mPaint->getColor() == 0xff000000 ?
+ deferInfo.batchId = mPaint->getColor() == SK_ColorBLACK ?
DeferredDisplayList::kOpBatch_Text :
DeferredDisplayList::kOpBatch_ColorText;
deferInfo.mergeId = reinterpret_cast<mergeid_t>(mPaint->getColor());
// don't merge decorated text - the decorations won't draw in order
- bool noDecorations = !(mPaint->getFlags() & (SkPaint::kUnderlineText_Flag |
- SkPaint::kStrikeThruText_Flag));
- deferInfo.mergeable = state.mMatrix.isPureTranslate() && noDecorations &&
- OpenGLRenderer::getXfermodeDirect(mPaint) == SkXfermode::kSrcOver_Mode;
+ bool hasDecorations = mPaint->getFlags()
+ & (SkPaint::kUnderlineText_Flag | SkPaint::kStrikeThruText_Flag);
+
+ deferInfo.mergeable = state.mMatrix.isPureTranslate()
+ && !hasDecorations
+ && OpenGLRenderer::getXfermodeDirect(mPaint) == SkXfermode::kSrcOver_Mode;
}
virtual status_t applyDraw(OpenGLRenderer& renderer, Rect& dirty) {