blob: 70a9077f5952a888dabe46e238f6ddb4284318bc [file] [log] [blame]
mtklein9c5052f2016-08-06 12:51:51 -07001/*
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
mtklein9c5052f2016-08-06 12:51:51 -070012DEF_TEST(SkLiteDL_basics, r) {
13 sk_sp<SkLiteDL> p { SkLiteDL::New({2,2,3,3}) };
14
15 p->save();
16 p->clipRect(SkRect{2,3,4,5}, SkRegion::kIntersect_Op, true);
17 p->drawRect(SkRect{0,0,9,9}, SkPaint{});
18 p->restore();
19}
20
21DEF_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();
30 c->clipRect(SkRect{2,3,4,5}, SkRegion::kIntersect_Op, true);
31 c->drawRect(SkRect{0,0,9,9}, SkPaint{});
32 c->restore();
33}