Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Unified Diff: skia/ext/analysis_canvas.cc

Issue 13726013: Smart layer invalidation for LCD text. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: skia/ext/analysis_canvas.cc
diff --git a/skia/ext/analysis_canvas.cc b/skia/ext/analysis_canvas.cc
index 93580b013288acecc3548baf0af3087261fb681c..2c9d826432e93b67f31417f3b82377263cb5f634 100644
--- a/skia/ext/analysis_canvas.cc
+++ b/skia/ext/analysis_canvas.cc
@@ -96,8 +96,8 @@ AnalysisDevice::AnalysisDevice(const SkBitmap& bm)
, isForcedNotSolid_(false)
, isForcedNotTransparent_(false)
, isSolidColor_(false)
- , isTransparent_(false) {
-
+ , isTransparent_(false)
+ , hasText_(false) {
}
AnalysisDevice::~AnalysisDevice() {
@@ -118,6 +118,10 @@ bool AnalysisDevice::isTransparent() const {
return isTransparent_;
}
+bool AnalysisDevice::hasText() const {
+ return hasText_;
+}
+
void AnalysisDevice::setForceNotSolid(bool flag) {
isForcedNotSolid_ = flag;
if (isForcedNotSolid_)
@@ -346,6 +350,7 @@ void AnalysisDevice::drawText(const SkDraw&, const void* text, size_t len,
}
isSolidColor_ = false;
isTransparent_ = false;
+ hasText_ = true;
}
void AnalysisDevice::drawPosText(const SkDraw& draw, const void* text,
@@ -361,6 +366,7 @@ void AnalysisDevice::drawPosText(const SkDraw& draw, const void* text,
}
isSolidColor_ = false;
isTransparent_ = false;
+ hasText_ = true;
}
void AnalysisDevice::drawTextOnPath(const SkDraw&, const void* text,
@@ -374,6 +380,7 @@ void AnalysisDevice::drawTextOnPath(const SkDraw&, const void* text,
}
isSolidColor_ = false;
isTransparent_ = false;
+ hasText_ = true;
}
#ifdef SK_BUILD_FOR_ANDROID
@@ -388,6 +395,7 @@ void AnalysisDevice::drawPosTextOnPath(const SkDraw& draw, const void* text,
}
isSolidColor_ = false;
isTransparent_ = false;
+ hasText_ = true;
}
#endif
@@ -441,6 +449,10 @@ bool AnalysisCanvas::isTransparent() const {
return (static_cast<AnalysisDevice*>(getDevice()))->isTransparent();
}
+bool AnalysisCanvas::hasText() const {
+ return (static_cast<AnalysisDevice*>(getDevice()))->hasText();
+}
+
int AnalysisCanvas::getEstimatedCost() const {
return (static_cast<AnalysisDevice*>(getDevice()))->getEstimatedCost();
}

Powered by Google App Engine
This is Rietveld 408576698