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

Side by Side Diff: gm/colorwheel.cpp

Issue 1810813003: update callsites for Make image factories (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: start to take advantage of sk_sp drawImage 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/colormatrix.cpp ('k') | gm/complexclip_blur_tiled.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 2014 Google Inc. 2 * Copyright 2014 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 "Resources.h" 8 #include "Resources.h"
9 #include "SkData.h" 9 #include "SkData.h"
10 #include "SkImage.h" 10 #include "SkImage.h"
11 #include "gm.h" 11 #include "gm.h"
12 #include "sk_tool_utils.h" 12 #include "sk_tool_utils.h"
13 13
14 static void draw_image(SkCanvas* canvas, const char* resource, int x, int y) { 14 static void draw_image(SkCanvas* canvas, const char* resource, int x, int y) {
15 SkAutoTUnref<SkImage> image(GetResourceAsImage(resource)); 15 sk_sp<SkImage> image(GetResourceAsImage(resource));
16 if (image) { 16 if (image) {
17 canvas->drawImage(image, SkIntToScalar(x), SkIntToScalar(y)); 17 canvas->drawImage(image, SkIntToScalar(x), SkIntToScalar(y));
18 } else { 18 } else {
19 SkDebugf("\nCould not decode file '%s'. Did you forget" 19 SkDebugf("\nCould not decode file '%s'. Did you forget"
20 " to set the resourcePath?\n", resource); 20 " to set the resourcePath?\n", resource);
21 } 21 }
22 } 22 }
23 23
24 /* 24 /*
25 This GM tests whether the image decoders properly decode each color 25 This GM tests whether the image decoders properly decode each color
(...skipping 26 matching lines...) Expand all
52 canvas->drawText("B", 1, 40.0f, 20.0f, paint); 52 canvas->drawText("B", 1, 40.0f, 20.0f, paint);
53 paint.setColor(SK_ColorCYAN); 53 paint.setColor(SK_ColorCYAN);
54 canvas->drawText("C", 1, 56.0f, 20.0f, paint); 54 canvas->drawText("C", 1, 56.0f, 20.0f, paint);
55 paint.setColor(SK_ColorMAGENTA); 55 paint.setColor(SK_ColorMAGENTA);
56 canvas->drawText("M", 1, 72.0f, 20.0f, paint); 56 canvas->drawText("M", 1, 72.0f, 20.0f, paint);
57 paint.setColor(SK_ColorYELLOW); 57 paint.setColor(SK_ColorYELLOW);
58 canvas->drawText("Y", 1, 88.0f, 20.0f, paint); 58 canvas->drawText("Y", 1, 88.0f, 20.0f, paint);
59 paint.setColor(SK_ColorBLACK); 59 paint.setColor(SK_ColorBLACK);
60 canvas->drawText("K", 1, 104.0f, 20.0f, paint); 60 canvas->drawText("K", 1, 104.0f, 20.0f, paint);
61 } 61 }
OLDNEW
« no previous file with comments | « gm/colormatrix.cpp ('k') | gm/complexclip_blur_tiled.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698