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

Unified Diff: src/core/SkXfermode_proccoeff.h

Issue 79543009: move SkProcCoeffXfermode unflatten constructor into .cpp, and range-check its mode (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 1 month 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
« src/core/SkXfermode.cpp ('K') | « src/core/SkXfermode.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkXfermode_proccoeff.h
diff --git a/src/core/SkXfermode_proccoeff.h b/src/core/SkXfermode_proccoeff.h
index df2b9743385ce0c3acfb52eb7a9eb168ec149d60..205edf2fa0c10a3378b3ea57f429962096b96ee3 100644
--- a/src/core/SkXfermode_proccoeff.h
+++ b/src/core/SkXfermode_proccoeff.h
@@ -12,8 +12,6 @@ struct ProcCoeff {
#define CANNOT_USE_COEFF SkXfermode::Coeff(-1)
-extern const ProcCoeff gProcCoeffs[];
-
class SkProcCoeffXfermode : public SkProcXfermode {
public:
SkProcCoeffXfermode(const ProcCoeff& rec, Mode mode)
@@ -37,16 +35,7 @@ public:
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkProcCoeffXfermode)
protected:
- SkProcCoeffXfermode(SkFlattenableReadBuffer& buffer) : INHERITED(buffer) {
- fMode = (SkXfermode::Mode)buffer.read32();
-
- const ProcCoeff& rec = gProcCoeffs[fMode];
- // these may be valid, or may be CANNOT_USE_COEFF
- fSrcCoeff = rec.fSC;
- fDstCoeff = rec.fDC;
- // now update our function-ptr in the super class
- this->INHERITED::setProc(rec.fProc);
- }
+ SkProcCoeffXfermode(SkFlattenableReadBuffer& buffer);
virtual void flatten(SkFlattenableWriteBuffer& buffer) const SK_OVERRIDE;
« src/core/SkXfermode.cpp ('K') | « src/core/SkXfermode.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698