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

Side by Side Diff: gm/blend.cpp

Issue 1316233002: Style Change: NULL->nullptr (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-27 (Thursday) 10:25:06 EDT Created 5 years, 3 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/bitmapsource2.cpp ('k') | gm/blurrect.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 * Copyright 2015 Google Inc. 2 * Copyright 2015 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 9
10 DEF_SIMPLE_GM(blend, canvas, 300, 100) { 10 DEF_SIMPLE_GM(blend, canvas, 300, 100) {
11 SkPaint p; 11 SkPaint p;
12 12
13 // All three of these blocks should be the same color. 13 // All three of these blocks should be the same color.
14 canvas->save(); 14 canvas->save();
15 canvas->scale(100,100); 15 canvas->scale(100,100);
16 16
17 p.setColor(SK_ColorRED); 17 p.setColor(SK_ColorRED);
18 canvas->drawRect(SkRect::MakeXYWH(0,0,1,1), p); 18 canvas->drawRect(SkRect::MakeXYWH(0,0,1,1), p);
19 p.setColor(0xFC008000); 19 p.setColor(0xFC008000);
20 canvas->drawRect(SkRect::MakeXYWH(0,0,1,1), p); 20 canvas->drawRect(SkRect::MakeXYWH(0,0,1,1), p);
21 21
22 p.setColor(SK_ColorRED); 22 p.setColor(SK_ColorRED);
23 canvas->drawRect(SkRect::MakeXYWH(1,0,1,1), p); 23 canvas->drawRect(SkRect::MakeXYWH(1,0,1,1), p);
24 canvas->saveLayer(NULL, NULL); 24 canvas->saveLayer(nullptr, nullptr);
25 p.setColor(0xFC008000); 25 p.setColor(0xFC008000);
26 canvas->drawRect(SkRect::MakeXYWH(1,0,1,1), p); 26 canvas->drawRect(SkRect::MakeXYWH(1,0,1,1), p);
27 canvas->restore(); 27 canvas->restore();
28 28
29 p.setColor(SK_ColorRED); 29 p.setColor(SK_ColorRED);
30 canvas->drawRect(SkRect::MakeXYWH(2,0,1,1), p); 30 canvas->drawRect(SkRect::MakeXYWH(2,0,1,1), p);
31 canvas->saveLayerAlpha(NULL, 0xFC); 31 canvas->saveLayerAlpha(nullptr, 0xFC);
32 p.setColor(sk_tool_utils::color_to_565(0xFF008000)); 32 p.setColor(sk_tool_utils::color_to_565(0xFF008000));
33 canvas->drawRect(SkRect::MakeXYWH(2,0,1,1), p); 33 canvas->drawRect(SkRect::MakeXYWH(2,0,1,1), p);
34 canvas->restore(); 34 canvas->restore();
35 canvas->restore(); 35 canvas->restore();
36 36
37 // Print out the colors in each block (if we're looking at 8888 raster). 37 // Print out the colors in each block (if we're looking at 8888 raster).
38 if (canvas->imageInfo().colorType() == kN32_SkColorType) { 38 if (canvas->imageInfo().colorType() == kN32_SkColorType) {
39 if (const SkPMColor* px = (const SkPMColor*)canvas->peekPixels(NULL, NUL L)) { 39 if (const SkPMColor* px = (const SkPMColor*)canvas->peekPixels(nullptr, nullptr)) {
40 p.setColor(SK_ColorWHITE); 40 p.setColor(SK_ColorWHITE);
41 for (int i = 0; i < 3; i++) { 41 for (int i = 0; i < 3; i++) {
42 SkPMColor c = px[i * 100]; 42 SkPMColor c = px[i * 100];
43 SkString text = SkStringPrintf("0x%08x", c); 43 SkString text = SkStringPrintf("0x%08x", c);
44 canvas->drawText(text.c_str(), text.size(), i * 100.0f + 20.0f, 50.0f, p); 44 canvas->drawText(text.c_str(), text.size(), i * 100.0f + 20.0f, 50.0f, p);
45 } 45 }
46 } 46 }
47 } 47 }
48 } 48 }
OLDNEW
« no previous file with comments | « gm/bitmapsource2.cpp ('k') | gm/blurrect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698