| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 | 52 |
| 53 virtual uint32_t onGetFlags() const SK_OVERRIDE { | 53 virtual uint32_t onGetFlags() const SK_OVERRIDE { |
| 54 return kSkipTiled_Flag; // Only for 565. 8888 is fine. | 54 return kSkipTiled_Flag; // Only for 565. 8888 is fine. |
| 55 } | 55 } |
| 56 | 56 |
| 57 virtual SkString onShortName() SK_OVERRIDE { | 57 virtual SkString onShortName() SK_OVERRIDE { |
| 58 return SkString("pathopsinverse"); | 58 return SkString("pathopsinverse"); |
| 59 } | 59 } |
| 60 | 60 |
| 61 virtual SkISize onISize() SK_OVERRIDE { | 61 virtual SkISize onISize() SK_OVERRIDE { |
| 62 return make_isize(1200, 900); | 62 return SkISize::Make(1200, 900); |
| 63 } | 63 } |
| 64 | 64 |
| 65 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { | 65 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { |
| 66 SkPath one, two; | 66 SkPath one, two; |
| 67 int yPos = 0; | 67 int yPos = 0; |
| 68 for (int oneFill = 0; oneFill <= 1; ++oneFill) { | 68 for (int oneFill = 0; oneFill <= 1; ++oneFill) { |
| 69 SkPath::FillType oneF = oneFill ? SkPath::kInverseEvenOdd_FillType | 69 SkPath::FillType oneF = oneFill ? SkPath::kInverseEvenOdd_FillType |
| 70 : SkPath::kEvenOdd_FillType; | 70 : SkPath::kEvenOdd_FillType; |
| 71 for (int twoFill = 0; twoFill <= 1; ++twoFill) { | 71 for (int twoFill = 0; twoFill <= 1; ++twoFill) { |
| 72 SkPath::FillType twoF = twoFill ? SkPath::kInverseEvenOdd_FillTy
pe | 72 SkPath::FillType twoF = twoFill ? SkPath::kInverseEvenOdd_FillTy
pe |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 SkPaint fOpPaint[kReverseDifference_PathOp - kDifference_PathOp + 1]; | 109 SkPaint fOpPaint[kReverseDifference_PathOp - kDifference_PathOp + 1]; |
| 110 typedef GM INHERITED; | 110 typedef GM INHERITED; |
| 111 }; | 111 }; |
| 112 | 112 |
| 113 ////////////////////////////////////////////////////////////////////////////// | 113 ////////////////////////////////////////////////////////////////////////////// |
| 114 | 114 |
| 115 static GM* MyFactory(void*) { return new PathOpsInverseGM; } | 115 static GM* MyFactory(void*) { return new PathOpsInverseGM; } |
| 116 static GMRegistry reg(MyFactory); | 116 static GMRegistry reg(MyFactory); |
| 117 | 117 |
| 118 } | 118 } |
| OLD | NEW |