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

Unified Diff: src/core/SkPathEffect.cpp

Issue 395603002: Simplify flattening to just write enough to call the factory (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years, 4 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
« no previous file with comments | « src/core/SkLocalMatrixShader.cpp ('k') | src/core/SkPictureShader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPathEffect.cpp
diff --git a/src/core/SkPathEffect.cpp b/src/core/SkPathEffect.cpp
index 01d5d6f9619a98ab5dfa012b05293da205dfe896..d0748670e36b3727d1d4d56ceb3e8b8369909687 100644
--- a/src/core/SkPathEffect.cpp
+++ b/src/core/SkPathEffect.cpp
@@ -45,19 +45,26 @@ SkPairPathEffect::~SkPairPathEffect() {
Format: [oe0-factory][pe1-factory][pe0-size][pe0-data][pe1-data]
*/
void SkPairPathEffect::flatten(SkWriteBuffer& buffer) const {
- this->INHERITED::flatten(buffer);
buffer.writeFlattenable(fPE0);
buffer.writeFlattenable(fPE1);
}
+#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
SkPairPathEffect::SkPairPathEffect(SkReadBuffer& buffer) {
fPE0 = buffer.readPathEffect();
fPE1 = buffer.readPathEffect();
// either of these may fail, so we have to check for nulls later on
}
+#endif
///////////////////////////////////////////////////////////////////////////////
+SkFlattenable* SkComposePathEffect::CreateProc(SkReadBuffer& buffer) {
+ SkAutoTUnref<SkPathEffect> pe0(buffer.readPathEffect());
+ SkAutoTUnref<SkPathEffect> pe1(buffer.readPathEffect());
+ return SkComposePathEffect::Create(pe0, pe1);
+}
+
bool SkComposePathEffect::filterPath(SkPath* dst, const SkPath& src,
SkStrokeRec* rec, const SkRect* cullRect) const {
// we may have failed to unflatten these, so we have to check
@@ -76,6 +83,12 @@ bool SkComposePathEffect::filterPath(SkPath* dst, const SkPath& src,
///////////////////////////////////////////////////////////////////////////////
+SkFlattenable* SkSumPathEffect::CreateProc(SkReadBuffer& buffer) {
+ SkAutoTUnref<SkPathEffect> pe0(buffer.readPathEffect());
+ SkAutoTUnref<SkPathEffect> pe1(buffer.readPathEffect());
+ return SkSumPathEffect::Create(pe0, pe1);
+}
+
bool SkSumPathEffect::filterPath(SkPath* dst, const SkPath& src,
SkStrokeRec* rec, const SkRect* cullRect) const {
// use bit-or so that we always call both, even if the first one succeeds
« no previous file with comments | « src/core/SkLocalMatrixShader.cpp ('k') | src/core/SkPictureShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698