OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 #include "SkProxyCanvas.h" | 8 #include "SkProxyCanvas.h" |
9 | 9 |
10 SkProxyCanvas::SkProxyCanvas(SkCanvas* proxy) : fProxy(proxy) { | 10 SkProxyCanvas::SkProxyCanvas(SkCanvas* proxy) : fProxy(proxy) { |
11 SkSafeRef(fProxy); | 11 SkSafeRef(fProxy); |
12 } | 12 } |
13 | 13 |
14 SkProxyCanvas::~SkProxyCanvas() { | 14 SkProxyCanvas::~SkProxyCanvas() { |
15 SkSafeUnref(fProxy); | 15 SkSafeUnref(fProxy); |
16 } | 16 } |
17 | 17 |
18 void SkProxyCanvas::setProxy(SkCanvas* proxy) { | 18 void SkProxyCanvas::setProxy(SkCanvas* proxy) { |
19 SkRefCnt_SafeAssign(fProxy, proxy); | 19 SkRefCnt_SafeAssign(fProxy, proxy); |
20 } | 20 } |
21 | 21 |
22 ///////////////////////////////// Overrides /////////// | 22 ///////////////////////////////// Overrides /////////// |
23 | 23 |
24 int SkProxyCanvas::save(SaveFlags flags) { | 24 void SkProxyCanvas::onSave(SaveFlags flags) { |
25 return fProxy->save(flags); | 25 fProxy->save(flags); |
| 26 this->INHERITED::onSave(flags); |
26 } | 27 } |
27 | 28 |
28 int SkProxyCanvas::saveLayer(const SkRect* bounds, const SkPaint* paint, | 29 bool SkProxyCanvas::onSaveLayer(const SkRect* bounds, const SkPaint* paint, |
29 SaveFlags flags) { | 30 SaveFlags flags) { |
30 return fProxy->saveLayer(bounds, paint, flags); | 31 fProxy->saveLayer(bounds, paint, flags); |
| 32 this->INHERITED::onSaveLayer(bounds, paint, flags); |
| 33 // No need for a layer. |
| 34 return false; |
31 } | 35 } |
32 | 36 |
33 void SkProxyCanvas::restore() { | 37 void SkProxyCanvas::onRestore() { |
34 fProxy->restore(); | 38 fProxy->restore(); |
| 39 this->INHERITED::onRestore(); |
35 } | 40 } |
36 | 41 |
37 bool SkProxyCanvas::translate(SkScalar dx, SkScalar dy) { | 42 bool SkProxyCanvas::translate(SkScalar dx, SkScalar dy) { |
38 return fProxy->translate(dx, dy); | 43 return fProxy->translate(dx, dy); |
39 } | 44 } |
40 | 45 |
41 bool SkProxyCanvas::scale(SkScalar sx, SkScalar sy) { | 46 bool SkProxyCanvas::scale(SkScalar sx, SkScalar sy) { |
42 return fProxy->scale(sx, sy); | 47 return fProxy->scale(sx, sy); |
43 } | 48 } |
44 | 49 |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 fProxy->endCommentGroup(); | 181 fProxy->endCommentGroup(); |
177 } | 182 } |
178 | 183 |
179 SkBounder* SkProxyCanvas::setBounder(SkBounder* bounder) { | 184 SkBounder* SkProxyCanvas::setBounder(SkBounder* bounder) { |
180 return fProxy->setBounder(bounder); | 185 return fProxy->setBounder(bounder); |
181 } | 186 } |
182 | 187 |
183 SkDrawFilter* SkProxyCanvas::setDrawFilter(SkDrawFilter* filter) { | 188 SkDrawFilter* SkProxyCanvas::setDrawFilter(SkDrawFilter* filter) { |
184 return fProxy->setDrawFilter(filter); | 189 return fProxy->setDrawFilter(filter); |
185 } | 190 } |
OLD | NEW |