mtklein | 9c5052f | 2016-08-06 12:51:51 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2016 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
| 8 | #include "Test.h" |
| 9 | #include "SkLiteDL.h" |
| 10 | #include "SkLiteRecorder.h" |
| 11 | |
mtklein | 9c5052f | 2016-08-06 12:51:51 -0700 | [diff] [blame] | 12 | DEF_TEST(SkLiteDL_basics, r) { |
| 13 | sk_sp<SkLiteDL> p { SkLiteDL::New({2,2,3,3}) }; |
| 14 | |
| 15 | p->save(); |
Mike Reed | c1f7774 | 2016-12-09 09:00:50 -0500 | [diff] [blame] | 16 | p->clipRect(SkRect{2,3,4,5}, kIntersect_SkClipOp, true); |
mtklein | 9c5052f | 2016-08-06 12:51:51 -0700 | [diff] [blame] | 17 | p->drawRect(SkRect{0,0,9,9}, SkPaint{}); |
| 18 | p->restore(); |
| 19 | } |
| 20 | |
| 21 | DEF_TEST(SkLiteRecorder, r) { |
| 22 | sk_sp<SkLiteDL> p { SkLiteDL::New({2,2,3,3}) }; |
| 23 | |
| 24 | SkLiteRecorder rec; |
| 25 | SkCanvas* c = &rec; |
| 26 | |
| 27 | rec.reset(p.get()); |
| 28 | |
| 29 | c->save(); |
Mike Reed | c1f7774 | 2016-12-09 09:00:50 -0500 | [diff] [blame] | 30 | c->clipRect(SkRect{2,3,4,5}, kIntersect_SkClipOp, true); |
mtklein | 9c5052f | 2016-08-06 12:51:51 -0700 | [diff] [blame] | 31 | c->drawRect(SkRect{0,0,9,9}, SkPaint{}); |
| 32 | c->restore(); |
| 33 | } |