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

Side by Side Diff: gm/imagefilterstransformed.cpp

Issue 2142033002: Factor code to rotate a canvas about a point. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Move to canvas. Created 4 years, 5 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
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 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 "SkBlurImageFilter.h" 9 #include "SkBlurImageFilter.h"
10 #include "SkColor.h" 10 #include "SkColor.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 for (auto& filter : filters) { 133 for (auto& filter : filters) {
134 paint.setAntiAlias(false); 134 paint.setAntiAlias(false);
135 paint.setImageFilter(filter); 135 paint.setImageFilter(filter);
136 136
137 canvas->save(); 137 canvas->save();
138 138
139 canvas->drawRect(r, paint); 139 canvas->drawRect(r, paint);
140 140
141 canvas->translate(150, 0); 141 canvas->translate(150, 0);
142 canvas->save(); 142 canvas->save();
143 canvas->translate(100, 100); 143 canvas->rotate(30, 100, 100);
144 canvas->rotate(30);
145 canvas->translate(-100, -100);
146 canvas->drawRect(r, paint); 144 canvas->drawRect(r, paint);
147 canvas->restore(); 145 canvas->restore();
148 146
149 paint.setAntiAlias(true); 147 paint.setAntiAlias(true);
150 canvas->translate(150, 0); 148 canvas->translate(150, 0);
151 canvas->save(); 149 canvas->save();
152 canvas->translate(100, 100); 150 canvas->rotate(30, 100, 100);
153 canvas->rotate(30);
154 canvas->translate(-100, -100);
155 canvas->drawRect(r, paint); 151 canvas->drawRect(r, paint);
156 canvas->restore(); 152 canvas->restore();
157 153
158 canvas->restore(); 154 canvas->restore();
159 canvas->translate(0, 150); 155 canvas->translate(0, 150);
160 } 156 }
161 } 157 }
OLDNEW
« no previous file with comments | « gm/fontscalerdistortable.cpp ('k') | gm/strokes.cpp » ('j') | src/core/SkCanvas.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698