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

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

Issue 105893012: change offset to xy for pixelref subsetting (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 11 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 | « include/core/SkBitmapDevice.h ('k') | include/core/SkPixelRef.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 2007 The Android Open Source Project 3 * Copyright 2007 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 SkPicture_DEFINED 10 #ifndef SkPicture_DEFINED
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 reflect the bounds of what has been recorded into the picture. 165 reflect the bounds of what has been recorded into the picture.
166 @return the height of the picture's recording canvas 166 @return the height of the picture's recording canvas
167 */ 167 */
168 int height() const { return fHeight; } 168 int height() const { return fHeight; }
169 169
170 /** 170 /**
171 * Function to encode an SkBitmap to an SkData. A function with this 171 * Function to encode an SkBitmap to an SkData. A function with this
172 * signature can be passed to serialize() and SkOrderedWriteBuffer. 172 * signature can be passed to serialize() and SkOrderedWriteBuffer.
173 * Returning NULL will tell the SkOrderedWriteBuffer to use 173 * Returning NULL will tell the SkOrderedWriteBuffer to use
174 * SkBitmap::flatten() to store the bitmap. 174 * SkBitmap::flatten() to store the bitmap.
175 * @param pixelRefOffset Output parameter, telling the deserializer what 175 *
176 * offset in the bm's pixelRef corresponds to the encoded data. 176 * @param pixelRefOffset DEPRECATED -- caller assumes it will return 0.
177 * @return SkData If non-NULL, holds encoded data representing the passed 177 * @return SkData If non-NULL, holds encoded data representing the passed
178 * in bitmap. The caller is responsible for calling unref(). 178 * in bitmap. The caller is responsible for calling unref().
179 */ 179 */
180 typedef SkData* (*EncodeBitmap)(size_t* pixelRefOffset, const SkBitmap& bm); 180 typedef SkData* (*EncodeBitmap)(size_t* pixelRefOffset, const SkBitmap& bm);
181 181
182 /** 182 /**
183 * Serialize to a stream. If non NULL, encoder will be used to encode 183 * Serialize to a stream. If non NULL, encoder will be used to encode
184 * any bitmaps in the picture. 184 * any bitmaps in the picture.
185 * encoder will never be called with a NULL pixelRefOffset. 185 * encoder will never be called with a NULL pixelRefOffset.
186 */ 186 */
(...skipping 27 matching lines...) Expand all
214 // SK_SUPPORT_HINTING_SCALE_FACTOR 214 // SK_SUPPORT_HINTING_SCALE_FACTOR
215 // V10: add drawRRect, drawOval, clipRRect 215 // V10: add drawRRect, drawOval, clipRRect
216 // V11: modify how readBitmap and writeBitmap store their info. 216 // V11: modify how readBitmap and writeBitmap store their info.
217 // V12: add conics to SkPath, use new SkPathRef flattening 217 // V12: add conics to SkPath, use new SkPathRef flattening
218 // V13: add flag to drawBitmapRectToRect 218 // V13: add flag to drawBitmapRectToRect
219 // parameterize blurs by sigma rather than radius 219 // parameterize blurs by sigma rather than radius
220 // V14: Add flags word to PathRef serialization 220 // V14: Add flags word to PathRef serialization
221 // V15: Remove A1 bitmpa config (and renumber remaining configs) 221 // V15: Remove A1 bitmpa config (and renumber remaining configs)
222 // V16: Move SkPath's isOval flag to SkPathRef 222 // V16: Move SkPath's isOval flag to SkPathRef
223 // V17: SkPixelRef now writes SkImageInfo 223 // V17: SkPixelRef now writes SkImageInfo
224 // V18: SkBitmap now records x,y for its pixelref origin, instead of offset.
224 #ifndef DELETE_THIS_CODE_WHEN_SKPS_ARE_REBUILT_AT_V16_AND_ALL_OTHER_INSTANCES_TO O 225 #ifndef DELETE_THIS_CODE_WHEN_SKPS_ARE_REBUILT_AT_V16_AND_ALL_OTHER_INSTANCES_TO O
225 static const uint32_t PRIOR_PICTURE_VERSION = 15; // TODO: remove when .skp s regenerated 226 static const uint32_t PRIOR_PICTURE_VERSION = 15; // TODO: remove when .skp s regenerated
226 #endif 227 #endif
227 static const uint32_t PICTURE_VERSION = 17; 228 static const uint32_t PICTURE_VERSION = 18;
228 229
229 // fPlayback, fRecord, fWidth & fHeight are protected to allow derived class es to 230 // fPlayback, fRecord, fWidth & fHeight are protected to allow derived class es to
230 // install their own SkPicturePlayback-derived players,SkPictureRecord-deriv ed 231 // install their own SkPicturePlayback-derived players,SkPictureRecord-deriv ed
231 // recorders and set the picture size 232 // recorders and set the picture size
232 SkPicturePlayback* fPlayback; 233 SkPicturePlayback* fPlayback;
233 SkPictureRecord* fRecord; 234 SkPictureRecord* fRecord;
234 int fWidth, fHeight; 235 int fWidth, fHeight;
235 236
236 // Create a new SkPicture from an existing SkPicturePlayback. Ref count of 237 // Create a new SkPicture from an existing SkPicturePlayback. Ref count of
237 // playback is unchanged. 238 // playback is unchanged.
(...skipping 27 matching lines...) Expand all
265 */ 266 */
266 class SK_API SkDrawPictureCallback { 267 class SK_API SkDrawPictureCallback {
267 public: 268 public:
268 SkDrawPictureCallback() {} 269 SkDrawPictureCallback() {}
269 virtual ~SkDrawPictureCallback() {} 270 virtual ~SkDrawPictureCallback() {}
270 271
271 virtual bool abortDrawing() = 0; 272 virtual bool abortDrawing() = 0;
272 }; 273 };
273 274
274 #endif 275 #endif
OLDNEW
« no previous file with comments | « include/core/SkBitmapDevice.h ('k') | include/core/SkPixelRef.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698