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

Side by Side Diff: gm/canvasstate.cpp

Issue 190723004: flag to make kClipToLayer_SaveFlag the default behavior (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: officially ignore the gm that was exercising this (now removed) feature Created 6 years, 9 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 | « expectations/gm/ignored-tests.txt ('k') | include/core/SkCanvas.h » ('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 * 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 125
126 virtual SkISize onISize() SK_OVERRIDE { 126 virtual SkISize onISize() SK_OVERRIDE {
127 return SkISize::Make(WIDTH, HEIGHT); 127 return SkISize::Make(WIDTH, HEIGHT);
128 } 128 }
129 129
130 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { 130 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE {
131 131
132 // clear the canvas to red 132 // clear the canvas to red
133 canvas->drawColor(SK_ColorRED); 133 canvas->drawColor(SK_ColorRED);
134 134
135 #ifdef SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG
135 // both rects should appear 136 // both rects should appear
136 drawTestPattern(canvas, 255, SkCanvas::kARGB_NoClipLayer_SaveFlag); 137 drawTestPattern(canvas, 255, SkCanvas::kARGB_NoClipLayer_SaveFlag);
137 138
138 canvas->translate(0, 2*(fRect.height() + 10)); 139 canvas->translate(0, 2*(fRect.height() + 10));
139 140
140 // only the top rect should appear 141 // only the top rect should appear
141 drawTestPattern(canvas, 255, SkCanvas::kARGB_ClipLayer_SaveFlag); 142 drawTestPattern(canvas, 255, SkCanvas::kARGB_ClipLayer_SaveFlag);
142 143
143 canvas->translate(0, 2*(fRect.height() + 10)); 144 canvas->translate(0, 2*(fRect.height() + 10));
144 145
145 // only the bottom rect should appear 146 // only the bottom rect should appear
146 drawTestPattern(canvas, 0, SkCanvas::kARGB_NoClipLayer_SaveFlag); 147 drawTestPattern(canvas, 0, SkCanvas::kARGB_NoClipLayer_SaveFlag);
148 #endif
147 } 149 }
148 150
149 virtual uint32_t onGetFlags() const SK_OVERRIDE { return kSkipGPU_Flag; } 151 virtual uint32_t onGetFlags() const SK_OVERRIDE { return kSkipGPU_Flag; }
150 152
151 private: 153 private:
152 // draw a rect within the layer's bounds and again outside the layer's bound s 154 // draw a rect within the layer's bounds and again outside the layer's bound s
153 void drawTestPattern(SkCanvas* canvas, U8CPU layerAlpha, SkCanvas::SaveFlags flags) { 155 void drawTestPattern(SkCanvas* canvas, U8CPU layerAlpha, SkCanvas::SaveFlags flags) {
154 canvas->saveLayerAlpha(&fRect, layerAlpha, flags); 156 canvas->saveLayerAlpha(&fRect, layerAlpha, flags);
155 canvas->drawRect(fRect, fBluePaint); 157 canvas->drawRect(fRect, fBluePaint);
156 canvas->translate(0, fRect.height() + 10); 158 canvas->translate(0, fRect.height() + 10);
(...skipping 12 matching lines...) Expand all
169 171
170 typedef GM INHERITED; 172 typedef GM INHERITED;
171 }; 173 };
172 174
173 ////////////////////////////////////////////////////////////////////////////// 175 //////////////////////////////////////////////////////////////////////////////
174 176
175 DEF_GM( return SkNEW(CanvasStateGM); ) 177 DEF_GM( return SkNEW(CanvasStateGM); )
176 DEF_GM( return SkNEW(CanvasLayerStateGM); ) 178 DEF_GM( return SkNEW(CanvasLayerStateGM); )
177 179
178 } // end namespace 180 } // end namespace
OLDNEW
« no previous file with comments | « expectations/gm/ignored-tests.txt ('k') | include/core/SkCanvas.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698