Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(192)

Side by Side Diff: src/utils/SkProxyCanvas.cpp

Issue 194923008: Revert "De-virtualize SkCanvas save/restore." (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/utils/SkNoSaveLayerCanvas.h ('k') | src/utils/debugger/SkDebugCanvas.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 void SkProxyCanvas::onSave(SaveFlags flags) { 24 int SkProxyCanvas::save(SaveFlags flags) {
25 fProxy->save(flags); 25 return fProxy->save(flags);
26 this->INHERITED::onSave(flags);
27 } 26 }
28 27
29 bool SkProxyCanvas::onSaveLayer(const SkRect* bounds, const SkPaint* paint, 28 int SkProxyCanvas::saveLayer(const SkRect* bounds, const SkPaint* paint,
30 SaveFlags flags) { 29 SaveFlags flags) {
31 fProxy->saveLayer(bounds, paint, flags); 30 return fProxy->saveLayer(bounds, paint, flags);
32 this->INHERITED::onSaveLayer(bounds, paint, flags);
33 // No need for a layer.
34 return false;
35 } 31 }
36 32
37 void SkProxyCanvas::onRestore() { 33 void SkProxyCanvas::restore() {
38 fProxy->restore(); 34 fProxy->restore();
39 this->INHERITED::onRestore();
40 } 35 }
41 36
42 bool SkProxyCanvas::translate(SkScalar dx, SkScalar dy) { 37 bool SkProxyCanvas::translate(SkScalar dx, SkScalar dy) {
43 return fProxy->translate(dx, dy); 38 return fProxy->translate(dx, dy);
44 } 39 }
45 40
46 bool SkProxyCanvas::scale(SkScalar sx, SkScalar sy) { 41 bool SkProxyCanvas::scale(SkScalar sx, SkScalar sy) {
47 return fProxy->scale(sx, sy); 42 return fProxy->scale(sx, sy);
48 } 43 }
49 44
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 fProxy->endCommentGroup(); 176 fProxy->endCommentGroup();
182 } 177 }
183 178
184 SkBounder* SkProxyCanvas::setBounder(SkBounder* bounder) { 179 SkBounder* SkProxyCanvas::setBounder(SkBounder* bounder) {
185 return fProxy->setBounder(bounder); 180 return fProxy->setBounder(bounder);
186 } 181 }
187 182
188 SkDrawFilter* SkProxyCanvas::setDrawFilter(SkDrawFilter* filter) { 183 SkDrawFilter* SkProxyCanvas::setDrawFilter(SkDrawFilter* filter) {
189 return fProxy->setDrawFilter(filter); 184 return fProxy->setDrawFilter(filter);
190 } 185 }
OLDNEW
« no previous file with comments | « src/utils/SkNoSaveLayerCanvas.h ('k') | src/utils/debugger/SkDebugCanvas.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698