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(); |
} |