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

Side by Side Diff: gm/xfermodes2.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/xfermodes.cpp ('k') | gm/xfermodes3.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 "SkShader.h" 10 #include "SkShader.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 canvas->save(); 47 canvas->save();
48 48
49 canvas->translate(x, y); 49 canvas->translate(x, y);
50 SkPaint p; 50 SkPaint p;
51 p.setAntiAlias(false); 51 p.setAntiAlias(false);
52 p.setStyle(SkPaint::kFill_Style); 52 p.setStyle(SkPaint::kFill_Style);
53 p.setShader(fBG); 53 p.setShader(fBG);
54 SkRect r = SkRect::MakeWH(w, h); 54 SkRect r = SkRect::MakeWH(w, h);
55 canvas->drawRect(r, p); 55 canvas->drawRect(r, p);
56 56
57 canvas->saveLayer(&r, NULL, SkCanvas::kARGB_ClipLayer_SaveFlag); 57 canvas->saveLayer(&r, NULL);
58 58
59 p.setShader(fDst); 59 p.setShader(fDst);
60 canvas->drawRect(r, p); 60 canvas->drawRect(r, p);
61 p.setShader(fSrc); 61 p.setShader(fSrc);
62 p.setXfermode(xm); 62 p.setXfermode(xm);
63 canvas->drawRect(r, p); 63 canvas->drawRect(r, p);
64 64
65 canvas->restore(); 65 canvas->restore();
66 66
67 r.inset(-SK_ScalarHalf, -SK_ScalarHalf); 67 r.inset(-SK_ScalarHalf, -SK_ScalarHalf);
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 144
145 typedef GM INHERITED; 145 typedef GM INHERITED;
146 }; 146 };
147 147
148 ////////////////////////////////////////////////////////////////////////////// 148 //////////////////////////////////////////////////////////////////////////////
149 149
150 static GM* MyFactory(void*) { return new Xfermodes2GM; } 150 static GM* MyFactory(void*) { return new Xfermodes2GM; }
151 static GMRegistry reg(MyFactory); 151 static GMRegistry reg(MyFactory);
152 152
153 } 153 }
OLDNEW
« no previous file with comments | « gm/xfermodes.cpp ('k') | gm/xfermodes3.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698