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

Side by Side Diff: gm/bitmapshader.cpp

Issue 1263553002: make pixelsnap textblob* etc gm portable (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add more 565 compatibility Created 5 years, 4 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 | « no previous file | gm/blurroundrect.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 /* 2 /*
3 * Copyright 2013 Google Inc. 3 * Copyright 2013 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 #include "gm.h" 8 #include "gm.h"
9 9
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 26 matching lines...) Expand all
37 37
38 static void adopt_shader(SkPaint* paint, SkShader* shader) { 38 static void adopt_shader(SkPaint* paint, SkShader* shader) {
39 paint->setShader(shader); 39 paint->setShader(shader);
40 SkSafeUnref(shader); 40 SkSafeUnref(shader);
41 } 41 }
42 42
43 class BitmapShaderGM : public GM { 43 class BitmapShaderGM : public GM {
44 44
45 protected: 45 protected:
46 void onOnceBeforeDraw() override { 46 void onOnceBeforeDraw() override {
47 this->setBGColor(SK_ColorGRAY); 47 this->setBGColor(sk_tool_utils::color_to_565(SK_ColorGRAY));
48 draw_bm(&fBitmap); 48 draw_bm(&fBitmap);
49 draw_mask(&fMask); 49 draw_mask(&fMask);
50 } 50 }
51 51
52 SkString onShortName() override { 52 SkString onShortName() override {
53 return SkString("bitmapshaders"); 53 return SkString("bitmapshaders");
54 } 54 }
55 55
56 SkISize onISize() override { 56 SkISize onISize() override {
57 return SkISize::Make(150, 100); 57 return SkISize::Make(150, 100);
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 109
110 typedef GM INHERITED; 110 typedef GM INHERITED;
111 }; 111 };
112 112
113 ////////////////////////////////////////////////////////////////////////////// 113 //////////////////////////////////////////////////////////////////////////////
114 114
115 static GM* MyFactory(void*) { return new BitmapShaderGM; } 115 static GM* MyFactory(void*) { return new BitmapShaderGM; }
116 static GMRegistry reg(MyFactory); 116 static GMRegistry reg(MyFactory);
117 117
118 } 118 }
OLDNEW
« no previous file with comments | « no previous file | gm/blurroundrect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698