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

Side by Side Diff: gm/texturedomaineffect.cpp

Issue 227563007: clear bitmap in texture domain gm (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: 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 | « 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 /* 2 /*
3 * Copyright 2014 Google Inc. 3 * Copyright 2014 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 8
9 // This test only works with the GPU backend. 9 // This test only works with the GPU backend.
10 10
(...skipping 28 matching lines...) Expand all
39 } 39 }
40 40
41 virtual uint32_t onGetFlags() const SK_OVERRIDE { 41 virtual uint32_t onGetFlags() const SK_OVERRIDE {
42 // This is a GPU-specific GM. 42 // This is a GPU-specific GM.
43 return kGPUOnly_Flag; 43 return kGPUOnly_Flag;
44 } 44 }
45 45
46 virtual void onOnceBeforeDraw() SK_OVERRIDE { 46 virtual void onOnceBeforeDraw() SK_OVERRIDE {
47 fBmp.allocN32Pixels(100, 100); 47 fBmp.allocN32Pixels(100, 100);
48 SkCanvas canvas(fBmp); 48 SkCanvas canvas(fBmp);
49 canvas.clear(0x00000000);
49 SkPaint paint; 50 SkPaint paint;
50 51
51 SkColor colors1[] = { SK_ColorCYAN, SK_ColorLTGRAY, SK_ColorGRAY }; 52 SkColor colors1[] = { SK_ColorCYAN, SK_ColorLTGRAY, SK_ColorGRAY };
52 paint.setShader(SkGradientShader::CreateSweep(65.f, 75.f, colors1, 53 paint.setShader(SkGradientShader::CreateSweep(65.f, 75.f, colors1,
53 NULL, SK_ARRAY_COUNT(color s1)))->unref(); 54 NULL, SK_ARRAY_COUNT(color s1)))->unref();
54 canvas.drawOval(SkRect::MakeXYWH(-5.f, -5.f, 55 canvas.drawOval(SkRect::MakeXYWH(-5.f, -5.f,
55 fBmp.width() + 10.f, fBmp.height() + 10 .f), paint); 56 fBmp.width() + 10.f, fBmp.height() + 10 .f), paint);
56 57
57 SkColor colors2[] = { SK_ColorMAGENTA, SK_ColorLTGRAY, SK_ColorYELLOW }; 58 SkColor colors2[] = { SK_ColorMAGENTA, SK_ColorLTGRAY, SK_ColorYELLOW };
58 paint.setShader(SkGradientShader::CreateSweep(45.f, 55.f, colors2, NULL, 59 paint.setShader(SkGradientShader::CreateSweep(45.f, 55.f, colors2, NULL,
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 private: 150 private:
150 SkBitmap fBmp; 151 SkBitmap fBmp;
151 152
152 typedef GM INHERITED; 153 typedef GM INHERITED;
153 }; 154 };
154 155
155 DEF_GM( return SkNEW(TextureDomainEffect); ) 156 DEF_GM( return SkNEW(TextureDomainEffect); )
156 } 157 }
157 158
158 #endif 159 #endif
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