| 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 "SkGraphics.h" | 10 #include "SkGraphics.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 SkPaint paint; | 37 SkPaint paint; |
| 38 paint.setAntiAlias(true); | 38 paint.setAntiAlias(true); |
| 39 | 39 |
| 40 SkRect rect; | 40 SkRect rect; |
| 41 #if 0 | 41 #if 0 |
| 42 bool hasInterior = path.hasRectangularInterior(&rect); | 42 bool hasInterior = path.hasRectangularInterior(&rect); |
| 43 #else | 43 #else |
| 44 bool hasInterior = false; | 44 bool hasInterior = false; |
| 45 #endif | 45 #endif |
| 46 | 46 |
| 47 paint.setColor(hasInterior ? 0xFF8888FF : SK_ColorGRAY); | 47 paint.setColor(sk_tool_utils::color_to_565(hasInterior ? 0xFF8888FF : SK
_ColorGRAY)); |
| 48 canvas->drawPath(path, paint); | 48 canvas->drawPath(path, paint); |
| 49 paint.setStyle(SkPaint::kStroke_Style); | 49 paint.setStyle(SkPaint::kStroke_Style); |
| 50 paint.setColor(SK_ColorRED); | 50 paint.setColor(SK_ColorRED); |
| 51 canvas->drawPath(path, paint); | 51 canvas->drawPath(path, paint); |
| 52 | 52 |
| 53 if (hasInterior) { | 53 if (hasInterior) { |
| 54 paint.setStyle(SkPaint::kFill_Style); | 54 paint.setStyle(SkPaint::kFill_Style); |
| 55 paint.setColor(0x8800FF00); | 55 paint.setColor(0x8800FF00); |
| 56 canvas->drawRect(rect, paint); | 56 canvas->drawRect(rect, paint); |
| 57 } | 57 } |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 | 104 |
| 105 private: | 105 private: |
| 106 | 106 |
| 107 typedef GM INHERITED; | 107 typedef GM INHERITED; |
| 108 }; | 108 }; |
| 109 | 109 |
| 110 ////////////////////////////////////////////////////////////////////////////// | 110 ////////////////////////////////////////////////////////////////////////////// |
| 111 | 111 |
| 112 static skiagm::GM* MyFactory(void*) { return new PathInteriorGM; } | 112 static skiagm::GM* MyFactory(void*) { return new PathInteriorGM; } |
| 113 static skiagm::GMRegistry reg(MyFactory); | 113 static skiagm::GMRegistry reg(MyFactory); |
| OLD | NEW |