| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "SkPath.h" | 10 #include "SkPath.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 AAClipGM() { | 69 AAClipGM() { |
| 70 | 70 |
| 71 } | 71 } |
| 72 | 72 |
| 73 protected: | 73 protected: |
| 74 virtual SkString onShortName() SK_OVERRIDE { | 74 virtual SkString onShortName() SK_OVERRIDE { |
| 75 return SkString("aaclip"); | 75 return SkString("aaclip"); |
| 76 } | 76 } |
| 77 | 77 |
| 78 virtual SkISize onISize() SK_OVERRIDE { | 78 virtual SkISize onISize() SK_OVERRIDE { |
| 79 return SkISize::Make(640, 480); | 79 return SkISize::Make(240, 120); |
| 80 } | 80 } |
| 81 | 81 |
| 82 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { | 82 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { |
| 83 // Initial pixel-boundary-aligned draw | 83 // Initial pixel-boundary-aligned draw |
| 84 draw_rect_tests(canvas); | 84 draw_rect_tests(canvas); |
| 85 | 85 |
| 86 // Repeat 4x with .2, .4, .6, .8 px offsets | 86 // Repeat 4x with .2, .4, .6, .8 px offsets |
| 87 canvas->translate(SK_Scalar1 / 5, SK_Scalar1 / 5); | 87 canvas->translate(SK_Scalar1 / 5, SK_Scalar1 / 5); |
| 88 canvas->translate(SkIntToScalar(50), 0); | 88 canvas->translate(SkIntToScalar(50), 0); |
| 89 draw_rect_tests(canvas); | 89 draw_rect_tests(canvas); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 101 draw_rect_tests(canvas); | 101 draw_rect_tests(canvas); |
| 102 } | 102 } |
| 103 | 103 |
| 104 virtual uint32_t onGetFlags() const { return kSkipPipe_Flag; } | 104 virtual uint32_t onGetFlags() const { return kSkipPipe_Flag; } |
| 105 | 105 |
| 106 private: | 106 private: |
| 107 typedef skiagm::GM INHERITED; | 107 typedef skiagm::GM INHERITED; |
| 108 }; | 108 }; |
| 109 | 109 |
| 110 DEF_GM( return SkNEW(AAClipGM); ) | 110 DEF_GM( return SkNEW(AAClipGM); ) |
| OLD | NEW |