am 13171876: am 8ca30207: Merge "Minor cleanups around color usage" into lmp-dev
* commit '1317187663ee869b9c6655abce1211cd1520ee11': Minor cleanups around color usage
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <SkCanvas.h>
|
||||
#include <SkColor.h>
|
||||
#include <SkShader.h>
|
||||
#include <SkTypeface.h>
|
||||
|
||||
@@ -1462,7 +1463,7 @@ void OpenGLRenderer::setStencilFromClip() {
|
||||
mSkipOutlineClip = true;
|
||||
|
||||
SkPaint paint;
|
||||
paint.setColor(0xff000000);
|
||||
paint.setColor(SK_ColorBLACK);
|
||||
paint.setXfermodeMode(SkXfermode::kSrc_Mode);
|
||||
|
||||
// NOTE: We could use the region contour path to generate a smaller mesh
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
#include <SkBitmap.h>
|
||||
#include <SkCanvas.h>
|
||||
#include <SkColor.h>
|
||||
#include <SkPaint.h>
|
||||
#include <SkPath.h>
|
||||
#include <SkRect.h>
|
||||
@@ -111,7 +112,7 @@ static void initBitmap(SkBitmap& bitmap, uint32_t width, uint32_t height) {
|
||||
static void initPaint(SkPaint& paint) {
|
||||
// Make sure the paint is opaque, color, alpha, filter, etc.
|
||||
// will be applied later when compositing the alpha8 texture
|
||||
paint.setColor(0xff000000);
|
||||
paint.setColor(SK_ColorBLACK);
|
||||
paint.setAlpha(255);
|
||||
paint.setColorFilter(NULL);
|
||||
paint.setMaskFilter(NULL);
|
||||
|
||||
Reference in New Issue
Block a user