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

Side by Side Diff: gm/imagefiltersbase.cpp

Issue 148883011: Make SkImageFilter methods const. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: More fixes to gm/ Created 6 years, 10 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 | « no previous file | gm/imagefiltersgraph.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 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 #include "gm.h" 8 #include "gm.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkColorFilter.h" 10 #include "SkColorFilter.h"
11 #include "SkColorPriv.h" 11 #include "SkColorPriv.h"
12 #include "SkShader.h" 12 #include "SkShader.h"
13 13
14 #include "SkBlurImageFilter.h" 14 #include "SkBlurImageFilter.h"
15 #include "SkColorFilterImageFilter.h" 15 #include "SkColorFilterImageFilter.h"
16 #include "SkDropShadowImageFilter.h" 16 #include "SkDropShadowImageFilter.h"
17 #include "SkTestImageFilters.h" 17 #include "SkTestImageFilters.h"
18 18
19 class FailImageFilter : public SkImageFilter { 19 class FailImageFilter : public SkImageFilter {
20 public: 20 public:
21 FailImageFilter() : INHERITED(0) {} 21 FailImageFilter() : INHERITED(0) {}
22 22
23 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(FailImageFilter) 23 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(FailImageFilter)
24 protected: 24 protected:
25 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&, 25 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&,
26 SkBitmap* result, SkIPoint* offset) { 26 SkBitmap* result, SkIPoint* offset) const {
27 return false; 27 return false;
28 } 28 }
29 29
30 FailImageFilter(SkReadBuffer& buffer) 30 FailImageFilter(SkReadBuffer& buffer)
31 : INHERITED(1, buffer) {} 31 : INHERITED(1, buffer) {}
32 32
33 private: 33 private:
34 typedef SkImageFilter INHERITED; 34 typedef SkImageFilter INHERITED;
35 }; 35 };
36 36
37 // register the filter with the flattenable registry 37 // register the filter with the flattenable registry
38 static SkFlattenable::Registrar gFailImageFilterReg("FailImageFilter", 38 static SkFlattenable::Registrar gFailImageFilterReg("FailImageFilter",
39 FailImageFilter::CreateProc, 39 FailImageFilter::CreateProc,
40 FailImageFilter::GetFlattena bleType()); 40 FailImageFilter::GetFlattena bleType());
41 41
42 class IdentityImageFilter : public SkImageFilter { 42 class IdentityImageFilter : public SkImageFilter {
43 public: 43 public:
44 IdentityImageFilter() : INHERITED(0) {} 44 IdentityImageFilter() : INHERITED(0) {}
45 45
46 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(IdentityImageFilter) 46 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(IdentityImageFilter)
47 protected: 47 protected:
48 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&, 48 virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&,
49 SkBitmap* result, SkIPoint* offset) { 49 SkBitmap* result, SkIPoint* offset) const {
50 *result = src; 50 *result = src;
51 return true; 51 return true;
52 } 52 }
53 53
54 IdentityImageFilter(SkReadBuffer& buffer) 54 IdentityImageFilter(SkReadBuffer& buffer)
55 : INHERITED(1, buffer) {} 55 : INHERITED(1, buffer) {}
56 56
57 private: 57 private:
58 typedef SkImageFilter INHERITED; 58 typedef SkImageFilter INHERITED;
59 }; 59 };
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 } 220 }
221 221
222 private: 222 private:
223 typedef GM INHERITED; 223 typedef GM INHERITED;
224 }; 224 };
225 225
226 /////////////////////////////////////////////////////////////////////////////// 226 ///////////////////////////////////////////////////////////////////////////////
227 227
228 static skiagm::GM* MyFactory(void*) { return new ImageFiltersBaseGM; } 228 static skiagm::GM* MyFactory(void*) { return new ImageFiltersBaseGM; }
229 static skiagm::GMRegistry reg(MyFactory); 229 static skiagm::GMRegistry reg(MyFactory);
OLDNEW
« no previous file with comments | « no previous file | gm/imagefiltersgraph.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698