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

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

Issue 143883006: No deduping dictionaries for matrices and regions. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: bump picture version Created 6 years, 11 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
« no previous file with comments | « src/effects/SkBlurMaskFilter.cpp ('k') | tests/CanvasTest.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 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
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 8
9 9
10 #include "SkEmbossMaskFilter.h" 10 #include "SkEmbossMaskFilter.h"
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 memcpy(dst->fImage, src.fImage, src.computeImageSize()); 127 memcpy(dst->fImage, src.fImage, src.computeImageSize());
128 128
129 return true; 129 return true;
130 } 130 }
131 131
132 SkEmbossMaskFilter::SkEmbossMaskFilter(SkFlattenableReadBuffer& buffer) 132 SkEmbossMaskFilter::SkEmbossMaskFilter(SkFlattenableReadBuffer& buffer)
133 : SkMaskFilter(buffer) { 133 : SkMaskFilter(buffer) {
134 SkASSERT(buffer.getArrayCount() == sizeof(Light)); 134 SkASSERT(buffer.getArrayCount() == sizeof(Light));
135 buffer.readByteArray(&fLight, sizeof(Light)); 135 buffer.readByteArray(&fLight, sizeof(Light));
136 SkASSERT(fLight.fPad == 0); // for the font-cache lookup to be clean 136 SkASSERT(fLight.fPad == 0); // for the font-cache lookup to be clean
137 #ifndef DELETE_THIS_CODE_WHEN_SKPS_ARE_REBUILT_AT_V16_AND_ALL_OTHER_INSTANCES_TO O 137 fBlurSigma = buffer.readScalar();
138 // TODO: Once skps are recaptured in > v15 this SkScalarAbs can be removed
139 #endif
140 fBlurSigma = SkScalarAbs(buffer.readScalar());
141 } 138 }
142 139
143 void SkEmbossMaskFilter::flatten(SkFlattenableWriteBuffer& buffer) const { 140 void SkEmbossMaskFilter::flatten(SkFlattenableWriteBuffer& buffer) const {
144 this->INHERITED::flatten(buffer); 141 this->INHERITED::flatten(buffer);
145 142
146 Light tmpLight = fLight; 143 Light tmpLight = fLight;
147 tmpLight.fPad = 0; // for the font-cache lookup to be clean 144 tmpLight.fPad = 0; // for the font-cache lookup to be clean
148 buffer.writeByteArray(&tmpLight, sizeof(tmpLight)); 145 buffer.writeByteArray(&tmpLight, sizeof(tmpLight));
149 buffer.writeScalar(fBlurSigma); 146 buffer.writeScalar(fBlurSigma);
150 } 147 }
(...skipping 11 matching lines...) Expand all
162 str->append(") "); 159 str->append(") ");
163 160
164 str->appendf("ambient: %d specular: %d ", 161 str->appendf("ambient: %d specular: %d ",
165 fLight.fAmbient, fLight.fSpecular); 162 fLight.fAmbient, fLight.fSpecular);
166 163
167 str->append("blurSigma: "); 164 str->append("blurSigma: ");
168 str->appendScalar(fBlurSigma); 165 str->appendScalar(fBlurSigma);
169 str->append(")"); 166 str->append(")");
170 } 167 }
171 #endif 168 #endif
OLDNEW
« no previous file with comments | « src/effects/SkBlurMaskFilter.cpp ('k') | tests/CanvasTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698