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

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

Issue 503833002: Reimplement deserialization of SkImageFilter's uniqueID. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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
« no previous file with comments | « src/core/SkImageFilter.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 * Copyright 2011 The Android Open Source Project 2 * Copyright 2011 The Android Open Source Project
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 #include "SkBitmap.h" 8 #include "SkBitmap.h"
9 #include "SkBlurImageFilter.h" 9 #include "SkBlurImageFilter.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 20 matching lines...) Expand all
31 buffer.validate(SkScalarIsFinite(fSigma.fWidth) && 31 buffer.validate(SkScalarIsFinite(fSigma.fWidth) &&
32 SkScalarIsFinite(fSigma.fHeight) && 32 SkScalarIsFinite(fSigma.fHeight) &&
33 (fSigma.fWidth >= 0) && 33 (fSigma.fWidth >= 0) &&
34 (fSigma.fHeight >= 0)); 34 (fSigma.fHeight >= 0));
35 } 35 }
36 #endif 36 #endif
37 37
38 SkBlurImageFilter::SkBlurImageFilter(SkScalar sigmaX, 38 SkBlurImageFilter::SkBlurImageFilter(SkScalar sigmaX,
39 SkScalar sigmaY, 39 SkScalar sigmaY,
40 SkImageFilter* input, 40 SkImageFilter* input,
41 const CropRect* cropRect) 41 const CropRect* cropRect,
42 : INHERITED(1, &input, cropRect), fSigma(SkSize::Make(sigmaX, sigmaY)) { 42 uint32_t uniqueID)
43 SkASSERT(sigmaX >= 0 && sigmaY >= 0); 43 : INHERITED(1, &input, cropRect, uniqueID), fSigma(SkSize::Make(sigmaX, sigm aY)) {
44 } 44 }
45 45
46 SkFlattenable* SkBlurImageFilter::CreateProc(SkReadBuffer& buffer) { 46 SkFlattenable* SkBlurImageFilter::CreateProc(SkReadBuffer& buffer) {
47 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1); 47 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1);
48 SkScalar sigmaX = buffer.readScalar(); 48 SkScalar sigmaX = buffer.readScalar();
49 SkScalar sigmaY = buffer.readScalar(); 49 SkScalar sigmaY = buffer.readScalar();
50 return Create(sigmaX, sigmaY, common.getInput(0), &common.cropRect()); 50 return Create(sigmaX, sigmaY, common.getInput(0), &common.cropRect(), common .uniqueID());
51 } 51 }
52 52
53 void SkBlurImageFilter::flatten(SkWriteBuffer& buffer) const { 53 void SkBlurImageFilter::flatten(SkWriteBuffer& buffer) const {
54 this->INHERITED::flatten(buffer); 54 this->INHERITED::flatten(buffer);
55 buffer.writeScalar(fSigma.fWidth); 55 buffer.writeScalar(fSigma.fWidth);
56 buffer.writeScalar(fSigma.fHeight); 56 buffer.writeScalar(fSigma.fHeight);
57 } 57 }
58 58
59 enum BlurDirection { 59 enum BlurDirection {
60 kX, kY 60 kX, kY
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 true, 291 true,
292 sigma.x(), 292 sigma.x(),
293 sigma.y())); 293 sigma.y()));
294 WrapTexture(tex, rect.width(), rect.height(), result); 294 WrapTexture(tex, rect.width(), rect.height(), result);
295 return true; 295 return true;
296 #else 296 #else
297 SkDEBUGFAIL("Should not call in GPU-less build"); 297 SkDEBUGFAIL("Should not call in GPU-less build");
298 return false; 298 return false;
299 #endif 299 #endif
300 } 300 }
OLDNEW
« no previous file with comments | « src/core/SkImageFilter.cpp ('k') | src/effects/SkColorFilterImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698