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 /* Description: | 8 /* Description: |
9 * This test defines a series of elementatry test steps that perform | 9 * This test defines a series of elementatry test steps that perform |
10 * a single or a small group of canvas API calls. Each test step is | 10 * a single or a small group of canvas API calls. Each test step is |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 SkIRect ar, br; | 183 SkIRect ar, br; |
184 a.getClipDeviceBounds(&ar); | 184 a.getClipDeviceBounds(&ar); |
185 b.getClipDeviceBounds(&br); | 185 b.getClipDeviceBounds(&br); |
186 return ar == br; | 186 return ar == br; |
187 } | 187 } |
188 | 188 |
189 class Canvas2CanvasClipVisitor : public SkCanvas::ClipVisitor { | 189 class Canvas2CanvasClipVisitor : public SkCanvas::ClipVisitor { |
190 public: | 190 public: |
191 Canvas2CanvasClipVisitor(SkCanvas* target) : fTarget(target) {} | 191 Canvas2CanvasClipVisitor(SkCanvas* target) : fTarget(target) {} |
192 | 192 |
193 void clipRect(const SkRect& r, SkRegion::Op op, bool aa) SK_OVERRIDE { | 193 void clipRect(const SkRect& r, SkRegion::Op op, bool aa) override { |
194 fTarget->clipRect(r, op, aa); | 194 fTarget->clipRect(r, op, aa); |
195 } | 195 } |
196 void clipRRect(const SkRRect& r, SkRegion::Op op, bool aa) SK_OVERRIDE { | 196 void clipRRect(const SkRRect& r, SkRegion::Op op, bool aa) override { |
197 fTarget->clipRRect(r, op, aa); | 197 fTarget->clipRRect(r, op, aa); |
198 } | 198 } |
199 void clipPath(const SkPath& p, SkRegion::Op op, bool aa) SK_OVERRIDE { | 199 void clipPath(const SkPath& p, SkRegion::Op op, bool aa) override { |
200 fTarget->clipPath(p, op, aa); | 200 fTarget->clipPath(p, op, aa); |
201 } | 201 } |
202 | 202 |
203 private: | 203 private: |
204 SkCanvas* fTarget; | 204 SkCanvas* fTarget; |
205 }; | 205 }; |
206 | 206 |
207 static void test_clipVisitor(skiatest::Reporter* reporter, SkCanvas* canvas) { | 207 static void test_clipVisitor(skiatest::Reporter* reporter, SkCanvas* canvas) { |
208 SkISize size = canvas->getDeviceSize(); | 208 SkISize size = canvas->getDeviceSize(); |
209 | 209 |
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
756 canvas.restore(); | 756 canvas.restore(); |
757 canvas.save(); | 757 canvas.save(); |
758 path.moveTo(5, 5); | 758 path.moveTo(5, 5); |
759 canvas.clipPath(path); | 759 canvas.clipPath(path); |
760 canvas.restore(); | 760 canvas.restore(); |
761 canvas.save(); | 761 canvas.save(); |
762 path.moveTo(7, 7); | 762 path.moveTo(7, 7); |
763 canvas.clipPath(path); // should not assert here | 763 canvas.clipPath(path); // should not assert here |
764 canvas.restore(); | 764 canvas.restore(); |
765 } | 765 } |
OLD | NEW |