| 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 | |
| 57 virtual SkString onShortName() SK_OVERRIDE { | 53 virtual SkString onShortName() SK_OVERRIDE { |
| 58 return SkString("pathopsinverse"); | 54 return SkString("pathopsinverse"); |
| 59 } | 55 } |
| 60 | 56 |
| 61 virtual SkISize onISize() SK_OVERRIDE { | 57 virtual SkISize onISize() SK_OVERRIDE { |
| 62 return SkISize::Make(1200, 900); | 58 return SkISize::Make(1200, 900); |
| 63 } | 59 } |
| 64 | 60 |
| 65 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { | 61 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { |
| 66 SkPath one, two; | 62 SkPath one, two; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 SkPaint fOpPaint[kReverseDifference_PathOp - kDifference_PathOp + 1]; | 105 SkPaint fOpPaint[kReverseDifference_PathOp - kDifference_PathOp + 1]; |
| 110 typedef GM INHERITED; | 106 typedef GM INHERITED; |
| 111 }; | 107 }; |
| 112 | 108 |
| 113 ////////////////////////////////////////////////////////////////////////////// | 109 ////////////////////////////////////////////////////////////////////////////// |
| 114 | 110 |
| 115 static GM* MyFactory(void*) { return new PathOpsInverseGM; } | 111 static GM* MyFactory(void*) { return new PathOpsInverseGM; } |
| 116 static GMRegistry reg(MyFactory); | 112 static GMRegistry reg(MyFactory); |
| 117 | 113 |
| 118 } | 114 } |
| OLD | NEW |