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

Side by Side Diff: gm/rrect.cpp

Issue 1262703002: make tests portable by using 565 compatible colors (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix dstreadshuffle text portable gm 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 | « gm/repeated_bitmap.cpp ('k') | gm/shallowgradient.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 2012 Google Inc. 2 * Copyright 2012 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 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkRRect.h" 10 #include "SkRRect.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 } 97 }
98 98
99 static void draw_rrect_color(SkCanvas* canvas, const SkRRect& rrect) { 99 static void draw_rrect_color(SkCanvas* canvas, const SkRRect& rrect) {
100 SkPaint paint; 100 SkPaint paint;
101 paint.setAntiAlias(true); 101 paint.setAntiAlias(true);
102 paint.setStyle(SkPaint::kStroke_Style); 102 paint.setStyle(SkPaint::kStroke_Style);
103 103
104 if (rrect.isRect()) { 104 if (rrect.isRect()) {
105 paint.setColor(SK_ColorRED); 105 paint.setColor(SK_ColorRED);
106 } else if (rrect.isOval()) { 106 } else if (rrect.isOval()) {
107 paint.setColor(0xFF008800); 107 paint.setColor(sk_tool_utils::color_to_565(0xFF008800));
108 } else if (rrect.isSimple()) { 108 } else if (rrect.isSimple()) {
109 paint.setColor(SK_ColorBLUE); 109 paint.setColor(SK_ColorBLUE);
110 } else { 110 } else {
111 paint.setColor(SK_ColorBLACK); 111 paint.setColor(SK_ColorBLACK);
112 } 112 }
113 canvas->drawRRect(rrect, paint); 113 canvas->drawRRect(rrect, paint);
114 } 114 }
115 115
116 static void drawrr(SkCanvas* canvas, const SkRRect& rrect, InsetProc proc) { 116 static void drawrr(SkCanvas* canvas, const SkRRect& rrect, InsetProc proc) {
117 SkRRect rr; 117 SkRRect rr;
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 canvas->restore(); 161 canvas->restore();
162 canvas->translate(0, 170); 162 canvas->translate(0, 170);
163 } 163 }
164 } 164 }
165 165
166 private: 166 private:
167 typedef GM INHERITED; 167 typedef GM INHERITED;
168 }; 168 };
169 169
170 DEF_GM( return new RRectGM; ) 170 DEF_GM( return new RRectGM; )
OLDNEW
« no previous file with comments | « gm/repeated_bitmap.cpp ('k') | gm/shallowgradient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698