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

Unified Diff: src/core/SkScalerContext.cpp

Issue 1853383002: Revert of Delete SkFlattenable::Type (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 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
« no previous file with comments | « src/core/SkReadBuffer.cpp ('k') | src/core/SkValidatingReadBuffer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkScalerContext.cpp
diff --git a/src/core/SkScalerContext.cpp b/src/core/SkScalerContext.cpp
index 3db9e308760da15acf06c219fe7fa3ab032ee2b5..cf4098bbdda9ccc07358d55415b6693f883e4aa8 100644
--- a/src/core/SkScalerContext.cpp
+++ b/src/core/SkScalerContext.cpp
@@ -62,14 +62,15 @@
#define DUMP_RECx
#endif
-static SkFlattenable* load_flattenable(const SkDescriptor* desc, uint32_t tag) {
+static SkFlattenable* load_flattenable(const SkDescriptor* desc, uint32_t tag,
+ SkFlattenable::Type ft) {
SkFlattenable* obj = nullptr;
uint32_t len;
const void* data = desc->findEntry(tag, &len);
if (data) {
SkReadBuffer buffer(data, len);
- obj = buffer.readFlattenable();
+ obj = buffer.readFlattenable(ft);
SkASSERT(buffer.offset() == buffer.size());
}
return obj;
@@ -79,9 +80,12 @@
: fRec(*static_cast<const Rec*>(desc->findEntry(kRec_SkDescriptorTag, nullptr)))
, fTypeface(SkRef(typeface))
- , fPathEffect(static_cast<SkPathEffect*>(load_flattenable(desc, kPathEffect_SkDescriptorTag)))
- , fMaskFilter(static_cast<SkMaskFilter*>(load_flattenable(desc, kMaskFilter_SkDescriptorTag)))
- , fRasterizer(static_cast<SkRasterizer*>(load_flattenable(desc, kRasterizer_SkDescriptorTag)))
+ , fPathEffect(static_cast<SkPathEffect*>(load_flattenable(desc, kPathEffect_SkDescriptorTag,
+ SkFlattenable::kSkPathEffect_Type)))
+ , fMaskFilter(static_cast<SkMaskFilter*>(load_flattenable(desc, kMaskFilter_SkDescriptorTag,
+ SkFlattenable::kSkMaskFilter_Type)))
+ , fRasterizer(static_cast<SkRasterizer*>(load_flattenable(desc, kRasterizer_SkDescriptorTag,
+ SkFlattenable::kSkRasterizer_Type)))
// Initialize based on our settings. Subclasses can also force this.
, fGenerateImageFromPath(fRec.fFrameWidth > 0 || fPathEffect != nullptr || fRasterizer != nullptr)
« no previous file with comments | « src/core/SkReadBuffer.cpp ('k') | src/core/SkValidatingReadBuffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698