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

Side by Side Diff: gm/strokerect.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 | « gm/samplerstress.cpp ('k') | gm/surface.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 "SkPath.h" 10 #include "SkPath.h"
11 11
12 #define STROKE_WIDTH SkIntToScalar(20) 12 #define STROKE_WIDTH SkIntToScalar(20)
13 13
14 static void draw_path(SkCanvas* canvas, const SkPath& path, const SkRect& rect, 14 static void draw_path(SkCanvas* canvas, const SkPath& path, const SkRect& rect,
15 SkPaint::Join join, int doFill) { 15 SkPaint::Join join, int doFill) {
16 SkPaint paint; 16 SkPaint paint;
17 paint.setAntiAlias(true); 17 paint.setAntiAlias(true);
18 paint.setStyle(doFill ? SkPaint::kStrokeAndFill_Style : SkPaint::kStroke_Sty le); 18 paint.setStyle(doFill ? SkPaint::kStrokeAndFill_Style : SkPaint::kStroke_Sty le);
19 19
20 paint.setColor(SK_ColorGRAY); 20 paint.setColor(sk_tool_utils::color_to_565(SK_ColorGRAY));
21 paint.setStrokeWidth(STROKE_WIDTH); 21 paint.setStrokeWidth(STROKE_WIDTH);
22 paint.setStrokeJoin(join); 22 paint.setStrokeJoin(join);
23 canvas->drawRect(rect, paint); 23 canvas->drawRect(rect, paint);
24 24
25 paint.setStyle(SkPaint::kStroke_Style); 25 paint.setStyle(SkPaint::kStroke_Style);
26 paint.setStrokeWidth(0); 26 paint.setStrokeWidth(0);
27 paint.setColor(SK_ColorRED); 27 paint.setColor(SK_ColorRED);
28 canvas->drawPath(path, paint); 28 canvas->drawPath(path, paint);
29 29
30 paint.setStrokeWidth(3); 30 paint.setStrokeWidth(3);
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 } 104 }
105 } 105 }
106 106
107 private: 107 private:
108 typedef GM INHERITED; 108 typedef GM INHERITED;
109 }; 109 };
110 110
111 //////////////////////////////////////////////////////////////////////////////// /////////////////// 111 //////////////////////////////////////////////////////////////////////////////// ///////////////////
112 112
113 DEF_GM(return new StrokeRectGM;) 113 DEF_GM(return new StrokeRectGM;)
OLDNEW
« no previous file with comments | « gm/samplerstress.cpp ('k') | gm/surface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698