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

Side by Side Diff: gm/imagefiltersbase.cpp

Issue 1853383002: Revert of Delete SkFlattenable::Type (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 8 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 "SkSpecialImage.h" 17 #include "SkSpecialImage.h"
18 #include "SkTestImageFilters.h" 18 #include "SkTestImageFilters.h"
19 19
20 class FailImageFilter : public SkImageFilter { 20 class FailImageFilter : public SkImageFilter {
21 public: 21 public:
22 class Registrar { 22 class Registrar {
23 public: 23 public:
24 Registrar() { 24 Registrar() {
25 SkFlattenable::Register("FailImageFilter", 25 SkFlattenable::Register("FailImageFilter",
26 FailImageFilter::CreateProc); 26 FailImageFilter::CreateProc,
27 FailImageFilter::GetFlattenableType());
27 } 28 }
28 }; 29 };
29 static sk_sp<SkImageFilter> Make() { 30 static sk_sp<SkImageFilter> Make() {
30 return sk_sp<SkImageFilter>(new FailImageFilter); 31 return sk_sp<SkImageFilter>(new FailImageFilter);
31 } 32 }
32 33
33 SK_TO_STRING_OVERRIDE() 34 SK_TO_STRING_OVERRIDE()
34 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(FailImageFilter) 35 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(FailImageFilter)
35 36
36 protected: 37 protected:
(...skipping 21 matching lines...) Expand all
58 str->append(")"); 59 str->append(")");
59 } 60 }
60 #endif 61 #endif
61 62
62 class IdentityImageFilter : public SkImageFilter { 63 class IdentityImageFilter : public SkImageFilter {
63 public: 64 public:
64 class Registrar { 65 class Registrar {
65 public: 66 public:
66 Registrar() { 67 Registrar() {
67 SkFlattenable::Register("IdentityImageFilter", 68 SkFlattenable::Register("IdentityImageFilter",
68 IdentityImageFilter::CreateProc); 69 IdentityImageFilter::CreateProc,
70 IdentityImageFilter::GetFlattenableType());
69 } 71 }
70 }; 72 };
71 static sk_sp<SkImageFilter> Make(sk_sp<SkImageFilter> input) { 73 static sk_sp<SkImageFilter> Make(sk_sp<SkImageFilter> input) {
72 return sk_sp<SkImageFilter>(new IdentityImageFilter(std::move(input))); 74 return sk_sp<SkImageFilter>(new IdentityImageFilter(std::move(input)));
73 } 75 }
74 76
75 SK_TO_STRING_OVERRIDE() 77 SK_TO_STRING_OVERRIDE()
76 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(IdentityImageFilter) 78 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(IdentityImageFilter)
77 79
78 protected: 80 protected:
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 318
317 class ImageFiltersText_CF : public ImageFiltersTextBaseGM { 319 class ImageFiltersText_CF : public ImageFiltersTextBaseGM {
318 public: 320 public:
319 ImageFiltersText_CF() : ImageFiltersTextBaseGM("color") {} 321 ImageFiltersText_CF() : ImageFiltersTextBaseGM("color") {}
320 322
321 void installFilter(SkPaint* paint) override { 323 void installFilter(SkPaint* paint) override {
322 paint->setColorFilter(SkColorFilter::MakeModeFilter(SK_ColorBLUE, SkXfer mode::kSrcIn_Mode)); 324 paint->setColorFilter(SkColorFilter::MakeModeFilter(SK_ColorBLUE, SkXfer mode::kSrcIn_Mode));
323 } 325 }
324 }; 326 };
325 DEF_GM( return new ImageFiltersText_CF; ) 327 DEF_GM( return new ImageFiltersText_CF; )
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