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

Side by Side Diff: samplecode/SampleLayerMask.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/xfermodes3.cpp ('k') | samplecode/SampleLayers.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 2011 Google Inc. 3 * Copyright 2011 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 "SampleCode.h" 8 #include "SampleCode.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkPaint.h" 10 #include "SkPaint.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 p.addOval(r); 50 p.addOval(r);
51 p.setFillType(SkPath::kInverseWinding_FillType); 51 p.setFillType(SkPath::kInverseWinding_FillType);
52 paint.setXfermodeMode(SkXfermode::kDstOut_Mode); 52 paint.setXfermodeMode(SkXfermode::kDstOut_Mode);
53 canvas->drawPath(p, paint); 53 canvas->drawPath(p, paint);
54 } 54 }
55 } 55 }
56 56
57 virtual void onDrawContent(SkCanvas* canvas) { 57 virtual void onDrawContent(SkCanvas* canvas) {
58 SkRect r; 58 SkRect r;
59 r.set(SkIntToScalar(20), SkIntToScalar(20), SkIntToScalar(120), SkIntToS calar(120)); 59 r.set(SkIntToScalar(20), SkIntToScalar(20), SkIntToScalar(120), SkIntToS calar(120));
60 canvas->saveLayer(&r, NULL, SkCanvas::kARGB_ClipLayer_SaveFlag); 60 canvas->saveLayer(&r, NULL);
61 canvas->drawColor(SK_ColorRED); 61 canvas->drawColor(SK_ColorRED);
62 drawMask(canvas, r); 62 drawMask(canvas, r);
63 canvas->restore(); 63 canvas->restore();
64 } 64 }
65 65
66 private: 66 private:
67 typedef SampleView INHERITED; 67 typedef SampleView INHERITED;
68 }; 68 };
69 69
70 /////////////////////////////////////////////////////////////////////////////// 70 ///////////////////////////////////////////////////////////////////////////////
71 71
72 static SkView* MyFactory() { return new LayerMaskView; } 72 static SkView* MyFactory() { return new LayerMaskView; }
73 static SkViewRegister reg(MyFactory); 73 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « gm/xfermodes3.cpp ('k') | samplecode/SampleLayers.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698