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

Side by Side Diff: gm/imagefiltersscaled.cpp

Issue 1300403003: Revert of Implement canComputeFastBounds() for image filters. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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 | « gm/colorfilterimagefilter.cpp ('k') | include/core/SkColorFilter.h » ('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 2014 Google Inc. 2 * Copyright 2014 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 "sk_tool_utils.h" 8 #include "sk_tool_utils.h"
9 #include "SkBitmapSource.h" 9 #include "SkBitmapSource.h"
10 #include "SkBlurImageFilter.h" 10 #include "SkBlurImageFilter.h"
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 124
125 for (size_t j = 0; j < SK_ARRAY_COUNT(scales); ++j) { 125 for (size_t j = 0; j < SK_ARRAY_COUNT(scales); ++j) {
126 canvas->save(); 126 canvas->save();
127 for (size_t i = 0; i < SK_ARRAY_COUNT(filters); ++i) { 127 for (size_t i = 0; i < SK_ARRAY_COUNT(filters); ++i) {
128 SkPaint paint; 128 SkPaint paint;
129 paint.setColor(SK_ColorBLUE); 129 paint.setColor(SK_ColorBLUE);
130 paint.setImageFilter(filters[i]); 130 paint.setImageFilter(filters[i]);
131 paint.setAntiAlias(true); 131 paint.setAntiAlias(true);
132 canvas->save(); 132 canvas->save();
133 canvas->scale(scales[j].fX, scales[j].fY); 133 canvas->scale(scales[j].fX, scales[j].fY);
134 canvas->clipRect(r);
135 if (5 == i) { 134 if (5 == i) {
136 canvas->translate(SkIntToScalar(-32), 0); 135 canvas->translate(SkIntToScalar(-32), 0);
137 } else if (6 == i) { 136 } else if (6 == i) {
138 canvas->scale(SkScalarInvert(RESIZE_FACTOR), 137 canvas->scale(SkScalarInvert(RESIZE_FACTOR),
139 SkScalarInvert(RESIZE_FACTOR)); 138 SkScalarInvert(RESIZE_FACTOR));
140 } 139 }
141 canvas->drawCircle(r.centerX(), r.centerY(), r.width()*2/5, pain t); 140 canvas->drawCircle(r.centerX(), r.centerY(), r.width()*2/5, pain t);
142 canvas->restore(); 141 canvas->restore();
143 canvas->translate(r.width() * scales[j].fX + margin, 0); 142 canvas->translate(r.width() * scales[j].fX + margin, 0);
144 } 143 }
(...skipping 12 matching lines...) Expand all
157 SkBitmap fGradientCircle; 156 SkBitmap fGradientCircle;
158 typedef GM INHERITED; 157 typedef GM INHERITED;
159 }; 158 };
160 159
161 ////////////////////////////////////////////////////////////////////////////// 160 //////////////////////////////////////////////////////////////////////////////
162 161
163 static GM* MyFactory(void*) { return new ImageFiltersScaledGM; } 162 static GM* MyFactory(void*) { return new ImageFiltersScaledGM; }
164 static GMRegistry reg(MyFactory); 163 static GMRegistry reg(MyFactory);
165 164
166 } 165 }
OLDNEW
« no previous file with comments | « gm/colorfilterimagefilter.cpp ('k') | include/core/SkColorFilter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698