summaryrefslogtreecommitdiffstats
path: root/libs/hwui/DisplayListOp.h
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2014-08-19 10:21:12 -0700
committerChris Craik <ccraik@google.com>2014-08-19 14:14:38 -0700
commit947eabf42d835d0dfb0daa2fe6d869139c7000d6 (patch)
treed61f3988b1fa795db04ba15235a0bc0e2cfab6bd /libs/hwui/DisplayListOp.h
parent49e057d7eedb44f5397781254acab4e0ef08a9cf (diff)
downloadframeworks_base-947eabf42d835d0dfb0daa2fe6d869139c7000d6.zip
frameworks_base-947eabf42d835d0dfb0daa2fe6d869139c7000d6.tar.gz
frameworks_base-947eabf42d835d0dfb0daa2fe6d869139c7000d6.tar.bz2
Early reject drawText calls that will not draw
bug:17114102 Prevents high contrast text from drawing invisible text. Also fixes stroked text bounds calculation. Change-Id: Iaeff51ead8b7b8ef2a1a0ca8b89598564e0d443f
Diffstat (limited to 'libs/hwui/DisplayListOp.h')
-rw-r--r--libs/hwui/DisplayListOp.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/libs/hwui/DisplayListOp.h b/libs/hwui/DisplayListOp.h
index c6d3db7..27356c7 100644
--- a/libs/hwui/DisplayListOp.h
+++ b/libs/hwui/DisplayListOp.h
@@ -999,6 +999,8 @@ class DrawStrokableOp : public DrawBoundedOp {
public:
DrawStrokableOp(float left, float top, float right, float bottom, const SkPaint* paint)
: DrawBoundedOp(left, top, right, bottom, paint) {};
+ DrawStrokableOp(const Rect& localBounds, const SkPaint* paint)
+ : DrawBoundedOp(localBounds, paint) {};
virtual bool getLocalBounds(Rect& localBounds) {
localBounds.set(mLocalBounds);
@@ -1337,11 +1339,11 @@ private:
const float* mPositions;
};
-class DrawTextOp : public DrawBoundedOp {
+class DrawTextOp : public DrawStrokableOp {
public:
DrawTextOp(const char* text, int bytesCount, int count, float x, float y,
const float* positions, const SkPaint* paint, float totalAdvance, const Rect& bounds)
- : DrawBoundedOp(bounds, paint), mText(text), mBytesCount(bytesCount), mCount(count),
+ : DrawStrokableOp(bounds, paint), mText(text), mBytesCount(bytesCount), mCount(count),
mX(x), mY(y), mPositions(positions), mTotalAdvance(totalAdvance) {
mPrecacheTransform = SkMatrix::InvalidMatrix();
}