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

Side by Side Diff: gm/xfermodes3.cpp

Issue 241453003: Reduce internal explicit SaveFlags usage. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Re-added needed save flag in SkPictureStateTree::Iterator::draw() Created 6 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 | Annotate | Revision Log
« no previous file with comments | « gm/xfermodes2.cpp ('k') | samplecode/SampleLayerMask.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 /* 2 /*
3 * Copyright 2013 Google Inc. 3 * Copyright 2013 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #include "gm.h" 8 #include "gm.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkGradientShader.h" 10 #include "SkGradientShader.h"
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 int x, int y, int w, int h, 145 int x, int y, int w, int h,
146 const SkPaint& modePaint, SkCanvas* layerCanvas) { 146 const SkPaint& modePaint, SkCanvas* layerCanvas) {
147 canvas->save(); 147 canvas->save();
148 148
149 canvas->translate(SkIntToScalar(x), SkIntToScalar(y)); 149 canvas->translate(SkIntToScalar(x), SkIntToScalar(y));
150 150
151 SkRect r = SkRect::MakeWH(SkIntToScalar(w), SkIntToScalar(h)); 151 SkRect r = SkRect::MakeWH(SkIntToScalar(w), SkIntToScalar(h));
152 152
153 SkCanvas* modeCanvas; 153 SkCanvas* modeCanvas;
154 if (NULL == layerCanvas) { 154 if (NULL == layerCanvas) {
155 canvas->saveLayer(&r, NULL, SkCanvas::kARGB_ClipLayer_SaveFlag); 155 canvas->saveLayer(&r, NULL);
156 modeCanvas = canvas; 156 modeCanvas = canvas;
157 } else { 157 } else {
158 modeCanvas = layerCanvas; 158 modeCanvas = layerCanvas;
159 } 159 }
160 160
161 SkPaint bgPaint; 161 SkPaint bgPaint;
162 bgPaint.setAntiAlias(false); 162 bgPaint.setAntiAlias(false);
163 bgPaint.setShader(fBGShader); 163 bgPaint.setShader(fBGShader);
164 modeCanvas->drawRect(r, bgPaint); 164 modeCanvas->drawRect(r, bgPaint);
165 modeCanvas->drawRect(r, modePaint); 165 modeCanvas->drawRect(r, modePaint);
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 SkAutoTUnref<SkShader> fBmpShader; 237 SkAutoTUnref<SkShader> fBmpShader;
238 238
239 typedef GM INHERITED; 239 typedef GM INHERITED;
240 }; 240 };
241 241
242 ////////////////////////////////////////////////////////////////////////////// 242 //////////////////////////////////////////////////////////////////////////////
243 243
244 DEF_GM(return new Xfermodes3GM;) 244 DEF_GM(return new Xfermodes3GM;)
245 245
246 } 246 }
OLDNEW
« no previous file with comments | « gm/xfermodes2.cpp ('k') | samplecode/SampleLayerMask.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698