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

Side by Side Diff: gm/bitmaprect.cpp

Issue 1776973003: partial switch over to sp usage of shaders (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: move into lua container Created 4 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
« no previous file with comments | « gm/bigmatrix.cpp ('k') | gm/bleed.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
2 /* 1 /*
3 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
4 * 3 *
5 * 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
6 * found in the LICENSE file. 5 * found in the LICENSE file.
7 */ 6 */
7
8 #include "gm.h" 8 #include "gm.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkGradientShader.h" 10 #include "SkGradientShader.h"
11 #include "SkGraphics.h" 11 #include "SkGraphics.h"
12 #include "SkPath.h" 12 #include "SkPath.h"
13 #include "SkRegion.h" 13 #include "SkRegion.h"
14 #include "SkShader.h" 14 #include "SkShader.h"
15 15
16 static void make_bitmap(SkBitmap* bitmap) { 16 static void make_bitmap(SkBitmap* bitmap) {
17 bitmap->allocN32Pixels(64, 64); 17 bitmap->allocN32Pixels(64, 64);
18 18
19 SkCanvas canvas(*bitmap); 19 SkCanvas canvas(*bitmap);
20 20
21 canvas.drawColor(SK_ColorRED); 21 canvas.drawColor(SK_ColorRED);
22 SkPaint paint; 22 SkPaint paint;
23 paint.setAntiAlias(true); 23 paint.setAntiAlias(true);
24 const SkPoint pts[] = { { 0, 0 }, { 64, 64 } }; 24 const SkPoint pts[] = { { 0, 0 }, { 64, 64 } };
25 const SkColor colors[] = { SK_ColorWHITE, SK_ColorBLUE }; 25 const SkColor colors[] = { SK_ColorWHITE, SK_ColorBLUE };
26 paint.setShader(SkGradientShader::CreateLinear(pts, colors, nullptr, 2, 26 paint.setShader(SkGradientShader::MakeLinear(pts, colors, nullptr, 2,
27 SkShader::kClamp_TileMode))-> unref(); 27 SkShader::kClamp_TileMode));
28 canvas.drawCircle(32, 32, 32, paint); 28 canvas.drawCircle(32, 32, 32, paint);
29 } 29 }
30 30
31 class DrawBitmapRect2 : public skiagm::GM { 31 class DrawBitmapRect2 : public skiagm::GM {
32 bool fUseIRect; 32 bool fUseIRect;
33 public: 33 public:
34 DrawBitmapRect2(bool useIRect) : fUseIRect(useIRect) { 34 DrawBitmapRect2(bool useIRect) : fUseIRect(useIRect) {
35 } 35 }
36 36
37 protected: 37 protected:
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 275
276 DEF_GM( return new DrawBitmapRect2(false); ) 276 DEF_GM( return new DrawBitmapRect2(false); )
277 DEF_GM( return new DrawBitmapRect2(true); ) 277 DEF_GM( return new DrawBitmapRect2(true); )
278 DEF_GM( return new DrawBitmapRect3(); ) 278 DEF_GM( return new DrawBitmapRect3(); )
279 279
280 #ifndef SK_BUILD_FOR_ANDROID 280 #ifndef SK_BUILD_FOR_ANDROID
281 DEF_GM( return new DrawBitmapRect4(false); ) 281 DEF_GM( return new DrawBitmapRect4(false); )
282 DEF_GM( return new DrawBitmapRect4(true); ) 282 DEF_GM( return new DrawBitmapRect4(true); )
283 #endif 283 #endif
284 284
OLDNEW
« no previous file with comments | « gm/bigmatrix.cpp ('k') | gm/bleed.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698