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

Side by Side Diff: include/core/SkCanvas.h

Issue 51033004: add SK_ATTR_DEPRECATED -- will need to disable for chrome, since it triggers a warning (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 1 month 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
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
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 8
9 9
10 #ifndef SkCanvas_DEFINED 10 #ifndef SkCanvas_DEFINED
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 SK_DECLARE_INST_COUNT(SkCanvas) 50 SK_DECLARE_INST_COUNT(SkCanvas)
51 51
52 SkCanvas(); 52 SkCanvas();
53 53
54 /** Construct a canvas with the specified device to draw into. 54 /** Construct a canvas with the specified device to draw into.
55 55
56 @param device Specifies a device for the canvas to draw into. 56 @param device Specifies a device for the canvas to draw into.
57 */ 57 */
58 explicit SkCanvas(SkBaseDevice* device); 58 explicit SkCanvas(SkBaseDevice* device);
59 59
60 /** Deprecated - Construct a canvas with the specified bitmap to draw into. 60 /** Construct a canvas with the specified bitmap to draw into.
61 @param bitmap Specifies a bitmap for the canvas to draw into. Its 61 @param bitmap Specifies a bitmap for the canvas to draw into. Its
62 structure are copied to the canvas. 62 structure are copied to the canvas.
63 */ 63 */
64 explicit SkCanvas(const SkBitmap& bitmap); 64 explicit SkCanvas(const SkBitmap& bitmap);
65 virtual ~SkCanvas(); 65 virtual ~SkCanvas();
66 66
67 SkMetaData& getMetaData(); 67 SkMetaData& getMetaData();
68 68
69 /////////////////////////////////////////////////////////////////////////// 69 ///////////////////////////////////////////////////////////////////////////
70 70
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 bool readPixels(SkBitmap* bitmap, 185 bool readPixels(SkBitmap* bitmap,
186 int x, int y, 186 int x, int y,
187 Config8888 config8888 = kNative_Premul_Config8888); 187 Config8888 config8888 = kNative_Premul_Config8888);
188 188
189 /** 189 /**
190 * DEPRECATED: This will be removed as soon as webkit is no longer relying 190 * DEPRECATED: This will be removed as soon as webkit is no longer relying
191 * on it. The bitmap is resized to the intersection of srcRect and the 191 * on it. The bitmap is resized to the intersection of srcRect and the
192 * canvas bounds. New pixels are always allocated on success. Bitmap is 192 * canvas bounds. New pixels are always allocated on success. Bitmap is
193 * unmodified on failure. 193 * unmodified on failure.
194 */ 194 */
195 SK_ATTR_DEPRECATED("use Config8888 version")
195 bool readPixels(const SkIRect& srcRect, SkBitmap* bitmap); 196 bool readPixels(const SkIRect& srcRect, SkBitmap* bitmap);
196 197
197 /** 198 /**
198 * Similar to draw sprite, this method will copy the pixels in bitmap onto 199 * Similar to draw sprite, this method will copy the pixels in bitmap onto
199 * the canvas, with the top/left corner specified by (x, y). The canvas' 200 * the canvas, with the top/left corner specified by (x, y). The canvas'
200 * pixel values are completely replaced: there is no blending. 201 * pixel values are completely replaced: there is no blending.
201 * 202 *
202 * Currently if bitmap is backed by a texture this is a no-op. This may be 203 * Currently if bitmap is backed by a texture this is a no-op. This may be
203 * relaxed in the future. 204 * relaxed in the future.
204 * 205 *
(...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after
935 kEmpty_ClipType = 0, 936 kEmpty_ClipType = 0,
936 kRect_ClipType, 937 kRect_ClipType,
937 kComplex_ClipType 938 kComplex_ClipType
938 }; 939 };
939 940
940 /** Returns a description of the total clip; may be cheaper than 941 /** Returns a description of the total clip; may be cheaper than
941 getting the clip and querying it directly. 942 getting the clip and querying it directly.
942 */ 943 */
943 ClipType getClipType() const; 944 ClipType getClipType() const;
944 945
945 /** Return the current device clip (concatenation of all clip calls). 946 /** DEPRECATED -- need to move this guy to private/friend
947 * Return the current device clip (concatenation of all clip calls).
946 * This does not account for the translate in any of the devices. 948 * This does not account for the translate in any of the devices.
947 * @return the current device clip (concatenation of all clip calls). 949 * @return the current device clip (concatenation of all clip calls).
948 *
949 * DEPRECATED -- call getClipDeviceBounds() instead.
950 */ 950 */
951 const SkRegion& getTotalClip() const; 951 const SkRegion& getTotalClip() const;
952 952
953 /** Return the clip stack. The clip stack stores all the individual 953 /** Return the clip stack. The clip stack stores all the individual
954 * clips organized by the save/restore frame in which they were 954 * clips organized by the save/restore frame in which they were
955 * added. 955 * added.
956 * @return the current clip stack ("list" of individual clip elements) 956 * @return the current clip stack ("list" of individual clip elements)
957 */ 957 */
958 const SkClipStack* getClipStack() const { 958 const SkClipStack* getClipStack() const {
959 return &fClipStack; 959 return &fClipStack;
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
1027 1027
1028 // Called by child classes that override clipPath and clipRRect to only 1028 // Called by child classes that override clipPath and clipRRect to only
1029 // track fast conservative clip bounds, rather than exact clips. 1029 // track fast conservative clip bounds, rather than exact clips.
1030 bool updateClipConservativelyUsingBounds(const SkRect&, SkRegion::Op, 1030 bool updateClipConservativelyUsingBounds(const SkRect&, SkRegion::Op,
1031 bool inverseFilled); 1031 bool inverseFilled);
1032 1032
1033 // notify our surface (if we have one) that we are about to draw, so it 1033 // notify our surface (if we have one) that we are about to draw, so it
1034 // can perform copy-on-write or invalidate any cached images 1034 // can perform copy-on-write or invalidate any cached images
1035 void predrawNotify(); 1035 void predrawNotify();
1036 1036
1037 /** DEPRECATED -- use constructor(device) 1037 /**
1038 1038 DEPRECATED -- need to remove when subclass stop relying on it.
1039 Marked as 'protected' to avoid new clients using this before we can 1039 Marked as 'protected' to avoid new clients using this before we can
1040 completely remove it. 1040 completely remove it.
1041 1041
1042 Specify a device for this canvas to draw into. If it is not null, its 1042 Specify a device for this canvas to draw into. If it is not null, its
1043 reference count is incremented. If the canvas was already holding a 1043 reference count is incremented. If the canvas was already holding a
1044 device, its reference count is decremented. The new device is returned. 1044 device, its reference count is decremented. The new device is returned.
1045 */ 1045 */
1046 virtual SkBaseDevice* setDevice(SkBaseDevice* device); 1046 virtual SkBaseDevice* setDevice(SkBaseDevice* device);
1047 1047
1048 private: 1048 private:
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
1190 if (NULL != fCanvas) { 1190 if (NULL != fCanvas) {
1191 fCanvas->endCommentGroup(); 1191 fCanvas->endCommentGroup();
1192 } 1192 }
1193 } 1193 }
1194 1194
1195 private: 1195 private:
1196 SkCanvas* fCanvas; 1196 SkCanvas* fCanvas;
1197 }; 1197 };
1198 1198
1199 #endif 1199 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698