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

Side by Side Diff: include/utils/SkDeferredCanvas.h

Issue 22385011: Removing deprecated constructors and setDevice from SkDeferredCanvas (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 4 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 | « gm/gmmain.cpp ('k') | src/utils/SkDeferredCanvas.cpp » ('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 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkDeferredCanvas_DEFINED 8 #ifndef SkDeferredCanvas_DEFINED
9 #define SkDeferredCanvas_DEFINED 9 #define SkDeferredCanvas_DEFINED
10 10
11 #include "SkCanvas.h" 11 #include "SkCanvas.h"
12 #include "SkPixelRef.h" 12 #include "SkPixelRef.h"
13 13
14 class DeferredDevice; 14 class DeferredDevice;
15 class SkImage; 15 class SkImage;
16 class SkSurface; 16 class SkSurface;
17 17
18 #if !defined(SK_DEFERRED_CANVAS_USES_FACTORIES)
19 // This is temporary, for rolling the API change into Chromium/Blink
20 #define SK_DEFERRED_CANVAS_USES_FACTORIES 0
21 #endif
22
23 /** \class SkDeferredCanvas 18 /** \class SkDeferredCanvas
24 Subclass of SkCanvas that encapsulates an SkPicture or SkGPipe for deferred 19 Subclass of SkCanvas that encapsulates an SkPicture or SkGPipe for deferred
25 drawing. The main difference between this class and SkPictureRecord (the 20 drawing. The main difference between this class and SkPictureRecord (the
26 canvas provided by SkPicture) is that this is a full drop-in replacement 21 canvas provided by SkPicture) is that this is a full drop-in replacement
27 for SkCanvas, while SkPictureRecord only supports draw operations. 22 for SkCanvas, while SkPictureRecord only supports draw operations.
28 SkDeferredCanvas will transparently trigger the flushing of deferred 23 SkDeferredCanvas will transparently trigger the flushing of deferred
29 draw operations when an attempt is made to access the pixel data. 24 draw operations when an attempt is made to access the pixel data.
30 */ 25 */
31 class SK_API SkDeferredCanvas : public SkCanvas { 26 class SK_API SkDeferredCanvas : public SkCanvas {
32 public: 27 public:
33 class NotificationClient; 28 class NotificationClient;
34 29
35 /** Construct a canvas with the specified surface to draw into. 30 /** Construct a canvas with the specified surface to draw into.
36 This factory must be used for newImageSnapshot to work. 31 This factory must be used for newImageSnapshot to work.
37 @param surface Specifies a surface for the canvas to draw into. 32 @param surface Specifies a surface for the canvas to draw into.
38 */ 33 */
39 static SkDeferredCanvas* Create(SkSurface* surface); 34 static SkDeferredCanvas* Create(SkSurface* surface);
40 35
41 #ifdef SK_DEVELOPER 36 #ifdef SK_DEVELOPER
42 static SkDeferredCanvas* Create(SkDevice* device); // Used for testing 37 static SkDeferredCanvas* Create(SkDevice* device); // Used for testing
43 #endif 38 #endif
44 39
45 #if !SK_DEFERRED_CANVAS_USES_FACTORIES
46 /** DEPRECATED
47 */
48 SkDeferredCanvas();
49
50 /** DEPRACATED, use create instead
Stephen White 2013/08/08 20:15:33 So is it deprecated, or depracated? I guess we'll
51 Construct a canvas with the specified device to draw into.
52 Equivalent to calling default constructor, then setDevice.
53 @param device Specifies a device for the canvas to draw into.
54 */
55 explicit SkDeferredCanvas(SkDevice* device);
56
57 /** DEPRECATED, use create instead
58 Construct a canvas with the specified surface to draw into.
59 This constructor must be used for newImageSnapshot to work.
60 @param surface Specifies a surface for the canvas to draw into.
61 */
62 explicit SkDeferredCanvas(SkSurface* surface);
63 #endif
64
65 virtual ~SkDeferredCanvas(); 40 virtual ~SkDeferredCanvas();
66 41
67 /** DEPRECATED
68 * Specify a device to be used by this canvas. Calling setDevice will
69 * release the previously set device, if any. Takes a reference on the
70 * device.
71 *
72 * @param device The device that the canvas will raw into
73 * @return The device argument, for convenience.
74 */
75 virtual SkDevice* setDevice(SkDevice* device);
76
77 /** 42 /**
78 * Specify the surface to be used by this canvas. Calling setSurface will 43 * Specify the surface to be used by this canvas. Calling setSurface will
79 * release the previously set surface or device. Takes a reference on the 44 * release the previously set surface or device. Takes a reference on the
80 * surface. 45 * surface.
81 * 46 *
82 * @param surface The surface that the canvas will raw into 47 * @param surface The surface that the canvas will raw into
83 * @return The surface argument, for convenience. 48 * @return The surface argument, for convenience.
84 */ 49 */
85 SkSurface* setSurface(SkSurface* surface); 50 SkSurface* setSurface(SkSurface* surface);
86 51
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 void validate() const; 249 void validate() const;
285 void init(); 250 void init();
286 bool fDeferredDrawing; 251 bool fDeferredDrawing;
287 252
288 friend class SkDeferredCanvasTester; // for unit testing 253 friend class SkDeferredCanvasTester; // for unit testing
289 typedef SkCanvas INHERITED; 254 typedef SkCanvas INHERITED;
290 }; 255 };
291 256
292 257
293 #endif 258 #endif
OLDNEW
« no previous file with comments | « gm/gmmain.cpp ('k') | src/utils/SkDeferredCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698