Index: src/core/SkDevice.cpp |
diff --git a/src/core/SkDevice.cpp b/src/core/SkDevice.cpp |
index 2f510700753d1c51d41e92ae83fbb204f61aa344..344118bc4d89866e77b798d4ed92dd5184430a69 100644 |
--- a/src/core/SkDevice.cpp |
+++ b/src/core/SkDevice.cpp |
@@ -8,6 +8,7 @@ |
#include "SkDevice.h" |
#include "SkDeviceProperties.h" |
#include "SkDraw.h" |
+#include "SkDrawFilter.h" |
#include "SkMetaData.h" |
#include "SkPatchUtils.h" |
#include "SkPathMeasure.h" |
@@ -130,8 +131,15 @@ void SkBaseDevice::drawTextBlob(const SkDraw& draw, const SkTextBlob* blob, SkSc |
size_t textLen = it.glyphCount() * sizeof(uint16_t); |
const SkPoint& offset = it.offset(); |
// applyFontToPaint() always overwrites the exact same attributes, |
- // so it is safe to not re-seed the paint. |
+ // so it is safe to not re-seed the paint for this reason. |
it.applyFontToPaint(&runPaint); |
+ |
+ // For drawTextBlob calls, we defer applying draw filters |
+ // until we have a complete run paint. |
+ if (!!draw.fDrawFilter) { |
reed1
2015/03/03 21:26:22
style: its fine to say
if (draw.fDrawFilter), no
|
+ draw.fDrawFilter->filter(&runPaint, SkDrawFilter::kText_Type); |
+ } |
+ |
runPaint.setFlags(this->filterTextFlags(runPaint)); |
switch (it.positioning()) { |
@@ -150,6 +158,11 @@ void SkBaseDevice::drawTextBlob(const SkDraw& draw, const SkTextBlob* blob, SkSc |
SkFAIL("unhandled positioning mode"); |
} |
+ if (!!draw.fDrawFilter) { |
+ // A draw filter may change the paint arbitrarily, so we must re-seed in this case. |
+ runPaint = paint; |
+ } |
+ |
it.next(); |
} |
} |