| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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; ) |
| OLD | NEW |