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

Side by Side Diff: include/effects/SkLayerDrawLooper.h

Issue 395603002: Simplify flattening to just write enough to call the factory (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: simplify xfermodes, fix SkLayerDrawLooper 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkLayerDrawLooper_DEFINED 8 #ifndef SkLayerDrawLooper_DEFINED
9 #define SkLayerDrawLooper_DEFINED 9 #define SkLayerDrawLooper_DEFINED
10 10
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 }; 74 };
75 75
76 virtual SkDrawLooper::Context* createContext(SkCanvas*, void* storage) const SK_OVERRIDE; 76 virtual SkDrawLooper::Context* createContext(SkCanvas*, void* storage) const SK_OVERRIDE;
77 77
78 virtual size_t contextSize() const SK_OVERRIDE { return sizeof(LayerDrawLoop erContext); } 78 virtual size_t contextSize() const SK_OVERRIDE { return sizeof(LayerDrawLoop erContext); }
79 79
80 virtual bool asABlurShadow(BlurShadowRec* rec) const SK_OVERRIDE; 80 virtual bool asABlurShadow(BlurShadowRec* rec) const SK_OVERRIDE;
81 81
82 SK_TO_STRING_OVERRIDE() 82 SK_TO_STRING_OVERRIDE()
83 83
84 /// Implements Flattenable.
85 virtual Factory getFactory() const SK_OVERRIDE { return CreateProc; } 84 virtual Factory getFactory() const SK_OVERRIDE { return CreateProc; }
86 static SkFlattenable* CreateProc(SkReadBuffer& buffer); 85 static SkFlattenable* CreateProc(SkReadBuffer& buffer);
86 #ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
87 static SkFlattenable* DeepCreateProc(SkReadBuffer& buffer) {
88 return CreateProc(buffer);
89 }
90 #endif
87 91
88 protected: 92 protected:
89 SkLayerDrawLooper(); 93 SkLayerDrawLooper();
90 94
91 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; 95 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
92 96
93 private: 97 private:
94 struct Rec { 98 struct Rec {
95 Rec* fNext; 99 Rec* fNext;
96 SkPaint fPaint; 100 SkPaint fPaint;
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 SkLayerDrawLooper* detachLooper(); 158 SkLayerDrawLooper* detachLooper();
155 159
156 private: 160 private:
157 Rec* fRecs; 161 Rec* fRecs;
158 Rec* fTopRec; 162 Rec* fTopRec;
159 int fCount; 163 int fCount;
160 }; 164 };
161 }; 165 };
162 166
163 #endif 167 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698