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

Side by Side Diff: gm/imagefilterscropped.cpp

Issue 27521002: Remove support for SK_CROP_RECT_IS_INT, now that it is no longer used in Blink or Chrome. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Add comment 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 | « no previous file | gm/lighting.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"
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 return kSkipScaledReplay_Flag; 126 return kSkipScaledReplay_Flag;
127 } 127 }
128 128
129 virtual void onDraw(SkCanvas* canvas) { 129 virtual void onDraw(SkCanvas* canvas) {
130 void (*drawProc[])(SkCanvas*, const SkRect&, SkImageFilter*) = { 130 void (*drawProc[])(SkCanvas*, const SkRect&, SkImageFilter*) = {
131 draw_sprite, draw_bitmap, draw_path, draw_paint, draw_text 131 draw_sprite, draw_bitmap, draw_path, draw_paint, draw_text
132 }; 132 };
133 133
134 SkAutoTUnref<SkColorFilter> cf( 134 SkAutoTUnref<SkColorFilter> cf(
135 SkColorFilter::CreateModeFilter(SK_ColorBLUE, SkXfermode::kSrcIn_Mod e)); 135 SkColorFilter::CreateModeFilter(SK_ColorBLUE, SkXfermode::kSrcIn_Mod e));
136 #ifdef SK_CROP_RECT_IS_INT
137 SkIRect cropRect = SkIRect::MakeXYWH(10, 10, 44, 44);
138 SkIRect bogusRect = SkIRect::MakeXYWH(-100, -100, 10, 10);
139 #else
140 SkImageFilter::CropRect cropRect(SkRect::Make(SkIRect::MakeXYWH(10, 10, 44, 44)), SkImageFilter::CropRect::kHasAll_CropEdge); 136 SkImageFilter::CropRect cropRect(SkRect::Make(SkIRect::MakeXYWH(10, 10, 44, 44)), SkImageFilter::CropRect::kHasAll_CropEdge);
141 SkImageFilter::CropRect bogusRect(SkRect::Make(SkIRect::MakeXYWH(-100, - 100, 10, 10)), SkImageFilter::CropRect::kHasAll_CropEdge); 137 SkImageFilter::CropRect bogusRect(SkRect::Make(SkIRect::MakeXYWH(-100, - 100, 10, 10)), SkImageFilter::CropRect::kHasAll_CropEdge);
142 #endif
143 138
144 SkAutoTUnref<SkImageFilter> offset(new SkOffsetImageFilter( 139 SkAutoTUnref<SkImageFilter> offset(new SkOffsetImageFilter(
145 SkIntToScalar(-10), SkIntToScalar(-10))); 140 SkIntToScalar(-10), SkIntToScalar(-10)));
146 141
147 SkAutoTUnref<SkImageFilter> cfOffset(SkColorFilterImageFilter::Create(cf .get(), offset.get())); 142 SkAutoTUnref<SkImageFilter> cfOffset(SkColorFilterImageFilter::Create(cf .get(), offset.get()));
148 143
149 SkImageFilter* filters[] = { 144 SkImageFilter* filters[] = {
150 NULL, 145 NULL,
151 SkColorFilterImageFilter::Create(cf.get(), NULL, &cropRect), 146 SkColorFilterImageFilter::Create(cf.get(), NULL, &cropRect),
152 new SkBlurImageFilter(1.0f, 1.0f, NULL, &cropRect), 147 new SkBlurImageFilter(1.0f, 1.0f, NULL, &cropRect),
(...skipping 27 matching lines...) Expand all
180 } 175 }
181 176
182 private: 177 private:
183 typedef GM INHERITED; 178 typedef GM INHERITED;
184 }; 179 };
185 180
186 /////////////////////////////////////////////////////////////////////////////// 181 ///////////////////////////////////////////////////////////////////////////////
187 182
188 static skiagm::GM* MyFactory(void*) { return new ImageFiltersCroppedGM; } 183 static skiagm::GM* MyFactory(void*) { return new ImageFiltersCroppedGM; }
189 static skiagm::GMRegistry reg(MyFactory); 184 static skiagm::GMRegistry reg(MyFactory);
OLDNEW
« no previous file with comments | « no previous file | gm/lighting.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698