| 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 #ifndef SkProxyCanvas_DEFINED | 8 #ifndef SkProxyCanvas_DEFINED |
| 9 #define SkProxyCanvas_DEFINED | 9 #define SkProxyCanvas_DEFINED |
| 10 | 10 |
| 11 #include "SkCanvas.h" | 11 #include "SkCanvas.h" |
| 12 | 12 |
| 13 /** This class overrides all virtual methods on SkCanvas, and redirects them | 13 /** This class overrides all virtual methods on SkCanvas, and redirects them |
| 14 to a "proxy", another SkCanvas instance. It can be the basis for | 14 to a "proxy", another SkCanvas instance. It can be the basis for |
| 15 intercepting (and possibly modifying) calls to a canvas. | 15 intercepting (and possibly modifying) calls to a canvas. |
| 16 | 16 |
| 17 There must be a proxy installed before the proxycanvas can be used (i.e. | 17 There must be a proxy installed before the proxycanvas can be used (i.e. |
| 18 before its virtual methods can be called). | 18 before its virtual methods can be called). |
| 19 */ | 19 */ |
| 20 class SkProxyCanvas : public SkCanvas { | 20 class SK_API SkProxyCanvas : public SkCanvas { |
| 21 public: | 21 public: |
| 22 SkProxyCanvas() : fProxy(NULL) {} | 22 SkProxyCanvas() : fProxy(NULL) {} |
| 23 SkProxyCanvas(SkCanvas* proxy); | 23 SkProxyCanvas(SkCanvas* proxy); |
| 24 virtual ~SkProxyCanvas(); | 24 virtual ~SkProxyCanvas(); |
| 25 | 25 |
| 26 SkCanvas* getProxy() const { return fProxy; } | 26 SkCanvas* getProxy() const { return fProxy; } |
| 27 void setProxy(SkCanvas* proxy); | 27 void setProxy(SkCanvas* proxy); |
| 28 | 28 |
| 29 virtual int save(SaveFlags flags = kMatrixClip_SaveFlag) SK_OVERRIDE; | 29 virtual int save(SaveFlags flags = kMatrixClip_SaveFlag) SK_OVERRIDE; |
| 30 virtual int saveLayer(const SkRect* bounds, const SkPaint* paint, | 30 virtual int saveLayer(const SkRect* bounds, const SkPaint* paint, |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 virtual SkBounder* setBounder(SkBounder* bounder) SK_OVERRIDE; | 84 virtual SkBounder* setBounder(SkBounder* bounder) SK_OVERRIDE; |
| 85 virtual SkDrawFilter* setDrawFilter(SkDrawFilter* filter) SK_OVERRIDE; | 85 virtual SkDrawFilter* setDrawFilter(SkDrawFilter* filter) SK_OVERRIDE; |
| 86 | 86 |
| 87 private: | 87 private: |
| 88 SkCanvas* fProxy; | 88 SkCanvas* fProxy; |
| 89 | 89 |
| 90 typedef SkCanvas INHERITED; | 90 typedef SkCanvas INHERITED; |
| 91 }; | 91 }; |
| 92 | 92 |
| 93 #endif | 93 #endif |
| OLD | NEW |