OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "SkBitmap.h" | 9 #include "SkBitmap.h" |
10 #include "SkPath.h" | 10 #include "SkPath.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 void* pixels = temp.getPixels(); | 43 void* pixels = temp.getPixels(); |
44 return *(SkColor*) pixels; | 44 return *(SkColor*) pixels; |
45 } | 45 } |
46 | 46 |
47 void makePaint(SkPaint* paint, SkColor color) { | 47 void makePaint(SkPaint* paint, SkColor color) { |
48 paint->setAntiAlias(true); | 48 paint->setAntiAlias(true); |
49 paint->setStyle(SkPaint::kFill_Style); | 49 paint->setStyle(SkPaint::kFill_Style); |
50 paint->setColor(color); | 50 paint->setColor(color); |
51 } | 51 } |
52 | 52 |
| 53 virtual uint32_t onGetFlags() const SK_OVERRIDE { |
| 54 return kSkipTiled_Flag; // Only for 565. 8888 is fine. |
| 55 } |
| 56 |
53 virtual SkString onShortName() SK_OVERRIDE { | 57 virtual SkString onShortName() SK_OVERRIDE { |
54 return SkString("pathopsinverse"); | 58 return SkString("pathopsinverse"); |
55 } | 59 } |
56 | 60 |
57 virtual SkISize onISize() SK_OVERRIDE { | 61 virtual SkISize onISize() SK_OVERRIDE { |
58 return make_isize(1200, 900); | 62 return make_isize(1200, 900); |
59 } | 63 } |
60 | 64 |
61 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { | 65 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { |
62 SkPath one, two; | 66 SkPath one, two; |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 SkPaint fOpPaint[kReverseDifference_PathOp - kDifference_PathOp + 1]; | 109 SkPaint fOpPaint[kReverseDifference_PathOp - kDifference_PathOp + 1]; |
106 typedef GM INHERITED; | 110 typedef GM INHERITED; |
107 }; | 111 }; |
108 | 112 |
109 ////////////////////////////////////////////////////////////////////////////// | 113 ////////////////////////////////////////////////////////////////////////////// |
110 | 114 |
111 static GM* MyFactory(void*) { return new PathOpsInverseGM; } | 115 static GM* MyFactory(void*) { return new PathOpsInverseGM; } |
112 static GMRegistry reg(MyFactory); | 116 static GMRegistry reg(MyFactory); |
113 | 117 |
114 } | 118 } |
OLD | NEW |