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

Side by Side Diff: gm/colorwheel.cpp

Issue 834633006: add ImageGenerator::NewFromData to porting layer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add helper for SkInstallDiscardablePixelRef(SkData*, ...) Created 5 years, 11 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
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 "SkDecodingImageGenerator.h"
11 #include "gm.h" 10 #include "gm.h"
12 #include "sk_tool_utils.h" 11 #include "sk_tool_utils.h"
13 12
14 static void checkerboard( 13 static void checkerboard(
15 SkCanvas* canvas, int w, int h, int size, SkColor c1, SkColor c2) { 14 SkCanvas* canvas, int w, int h, int size, SkColor c1, SkColor c2) {
16 SkAutoCanvasRestore autoCanvasRestore(canvas, true); 15 SkAutoCanvasRestore autoCanvasRestore(canvas, true);
17 canvas->clipRect(SkRect::MakeWH(SkIntToScalar(w), SkIntToScalar(h))); 16 canvas->clipRect(SkRect::MakeWH(SkIntToScalar(w), SkIntToScalar(h)));
18 canvas->drawColor(c1); 17 canvas->drawColor(c1);
19 SkPaint paint; 18 SkPaint paint;
20 paint.setColor(c2); 19 paint.setColor(c2);
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 canvas->drawText("B", 1, 40.0f, 20.0f, paint); 70 canvas->drawText("B", 1, 40.0f, 20.0f, paint);
72 paint.setColor(SK_ColorCYAN); 71 paint.setColor(SK_ColorCYAN);
73 canvas->drawText("C", 1, 56.0f, 20.0f, paint); 72 canvas->drawText("C", 1, 56.0f, 20.0f, paint);
74 paint.setColor(SK_ColorMAGENTA); 73 paint.setColor(SK_ColorMAGENTA);
75 canvas->drawText("M", 1, 72.0f, 20.0f, paint); 74 canvas->drawText("M", 1, 72.0f, 20.0f, paint);
76 paint.setColor(SK_ColorYELLOW); 75 paint.setColor(SK_ColorYELLOW);
77 canvas->drawText("Y", 1, 88.0f, 20.0f, paint); 76 canvas->drawText("Y", 1, 88.0f, 20.0f, paint);
78 paint.setColor(SK_ColorBLACK); 77 paint.setColor(SK_ColorBLACK);
79 canvas->drawText("K", 1, 104.0f, 20.0f, paint); 78 canvas->drawText("K", 1, 104.0f, 20.0f, paint);
80 } 79 }
OLDNEW
« no previous file with comments | « gm/astcbitmap.cpp ('k') | gm/etc1bitmap.cpp » ('j') | include/core/SkImageGenerator.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698