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

Side by Side Diff: src/effects/SkBlurDrawLooper.cpp

Issue 26702002: force readbuffer clients to use specialized readFoo for flattenables (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « src/core/SkScalerContext.cpp ('k') | src/effects/SkColorFilterImageFilter.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #include "SkBlurDrawLooper.h" 8 #include "SkBlurDrawLooper.h"
9 #include "SkBlurMask.h" // just for SkBlurMask::ConvertRadiusToSigma 9 #include "SkBlurMask.h" // just for SkBlurMask::ConvertRadiusToSigma
10 #include "SkBlurMaskFilter.h" 10 #include "SkBlurMaskFilter.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 fColorFilter = NULL; 62 fColorFilter = NULL;
63 } 63 }
64 } 64 }
65 65
66 SkBlurDrawLooper::SkBlurDrawLooper(SkFlattenableReadBuffer& buffer) 66 SkBlurDrawLooper::SkBlurDrawLooper(SkFlattenableReadBuffer& buffer)
67 : INHERITED(buffer) { 67 : INHERITED(buffer) {
68 68
69 fDx = buffer.readScalar(); 69 fDx = buffer.readScalar();
70 fDy = buffer.readScalar(); 70 fDy = buffer.readScalar();
71 fBlurColor = buffer.readColor(); 71 fBlurColor = buffer.readColor();
72 fBlur = buffer.readFlattenableT<SkMaskFilter>(); 72 fBlur = buffer.readMaskFilter();
73 fColorFilter = buffer.readFlattenableT<SkColorFilter>(); 73 fColorFilter = buffer.readColorFilter();
74 fBlurFlags = buffer.readUInt() & kAll_BlurFlag; 74 fBlurFlags = buffer.readUInt() & kAll_BlurFlag;
75 } 75 }
76 76
77 SkBlurDrawLooper::~SkBlurDrawLooper() { 77 SkBlurDrawLooper::~SkBlurDrawLooper() {
78 SkSafeUnref(fBlur); 78 SkSafeUnref(fBlur);
79 SkSafeUnref(fColorFilter); 79 SkSafeUnref(fColorFilter);
80 } 80 }
81 81
82 void SkBlurDrawLooper::flatten(SkFlattenableWriteBuffer& buffer) const { 82 void SkBlurDrawLooper::flatten(SkFlattenableWriteBuffer& buffer) const {
83 this->INHERITED::flatten(buffer); 83 this->INHERITED::flatten(buffer);
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 &needsSeparator); 157 &needsSeparator);
158 SkAddFlagToString(str, SkToBool(kHighQuality_BlurFlag & fBlurFlags), "Hi ghQuality", 158 SkAddFlagToString(str, SkToBool(kHighQuality_BlurFlag & fBlurFlags), "Hi ghQuality",
159 &needsSeparator); 159 &needsSeparator);
160 } 160 }
161 str->append(")"); 161 str->append(")");
162 162
163 // TODO: add optional "fBlurFilter->toString(str);" when SkMaskFilter::toStr ing is added 163 // TODO: add optional "fBlurFilter->toString(str);" when SkMaskFilter::toStr ing is added
164 // alternatively we could cache the radius in SkBlurDrawLooper and just add it here 164 // alternatively we could cache the radius in SkBlurDrawLooper and just add it here
165 } 165 }
166 #endif 166 #endif
OLDNEW
« no previous file with comments | « src/core/SkScalerContext.cpp ('k') | src/effects/SkColorFilterImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698