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

Side by Side Diff: gm/canvasstate.cpp

Issue 22937005: fix mac build errors related to new gm (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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 2013 Google Inc. 2 * Copyright 2013 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 "gm.h" 8 #include "gm.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkPaint.h" 10 #include "SkPaint.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 for (size_t i = 0; i < SK_ARRAY_COUNT(flags); ++i) { 74 for (size_t i = 0; i < SK_ARRAY_COUNT(flags); ++i) {
75 for (int j = 0; j < 2; ++j) { 75 for (int j = 0; j < 2; ++j) {
76 for (int k = 0; k < 2; ++k) { 76 for (int k = 0; k < 2; ++k) {
77 this->drawTestPattern(i, (2*j)+k, canvas, flags[i], j, k); 77 this->drawTestPattern(i, (2*j)+k, canvas, flags[i], j, k);
78 } 78 }
79 } 79 }
80 } 80 }
81 } 81 }
82 82
83 83
84 virtual uint32_t onGetFlags() SK_OVERRIDE const { return kSkipPicture_Flag; } 84 virtual uint32_t onGetFlags() const SK_OVERRIDE { return kSkipPicture_Flag; }
85 85
86 private: 86 private:
87 void drawTestPattern(int x, int y, SkCanvas* canvas, 87 void drawTestPattern(int x, int y, SkCanvas* canvas,
88 SkCanvas::SaveFlags flags, bool doClip, bool doScale) { 88 SkCanvas::SaveFlags flags, bool doClip, bool doScale) {
89 canvas->save(); 89 canvas->save();
90 canvas->translate(x*WIDTH, y*HEIGHT); 90 canvas->translate(x*WIDTH, y*HEIGHT);
91 91
92 canvas->drawRect(fOutlineRect, fStrokePaint); 92 canvas->drawRect(fOutlineRect, fStrokePaint);
93 canvas->save(flags); 93 canvas->save(flags);
94 if(doClip) { 94 if(doClip) {
95 canvas->clipPath(fPath); 95 canvas->clipPath(fPath);
96 } 96 }
97 if (doScale) { 97 if (doScale) {
98 canvas->scale(0.5, 0.5); 98 canvas->scale(SkDoubleToScalar(0.5), SkDoubleToScalar(0.5));
99 } 99 }
100 canvas->restore(); 100 canvas->restore();
101 canvas->drawRect(fFillRect, fFillPaint); 101 canvas->drawRect(fFillRect, fFillPaint);
102 102
103 canvas->restore(); 103 canvas->restore();
104 } 104 }
105 105
106 typedef GM INHERITED; 106 typedef GM INHERITED;
107 }; 107 };
108 108
109 ////////////////////////////////////////////////////////////////////////////// 109 //////////////////////////////////////////////////////////////////////////////
110 110
111 DEF_GM( return SkNEW(CanvasStateGM); ) 111 DEF_GM( return SkNEW(CanvasStateGM); )
112 112
113 } // end namespace 113 } // end namespace
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698