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

Side by Side Diff: include/core/SkBitmapDevice.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
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2013 Google Inc. 3 * Copyright 2013 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 8
9 #ifndef SkBitmapDevice_DEFINED 9 #ifndef SkBitmapDevice_DEFINED
10 #define SkBitmapDevice_DEFINED 10 #define SkBitmapDevice_DEFINED
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 192
193 /** Update as needed the pixel value in the bitmap, so that the caller can 193 /** Update as needed the pixel value in the bitmap, so that the caller can
194 access the pixels directly. Note: only the pixels field should be 194 access the pixels directly. Note: only the pixels field should be
195 altered. The config/width/height/rowbytes must remain unchanged. 195 altered. The config/width/height/rowbytes must remain unchanged.
196 @return the device contents as a bitmap 196 @return the device contents as a bitmap
197 */ 197 */
198 virtual const SkBitmap& onAccessBitmap() SK_OVERRIDE; 198 virtual const SkBitmap& onAccessBitmap() SK_OVERRIDE;
199 199
200 SkPixelRef* getPixelRef() const { return fBitmap.pixelRef(); } 200 SkPixelRef* getPixelRef() const { return fBitmap.pixelRef(); }
201 // just for subclasses, to assign a custom pixelref 201 // just for subclasses, to assign a custom pixelref
202 SkPixelRef* setPixelRef(SkPixelRef* pr, size_t offset) { 202 SkPixelRef* setPixelRef(SkPixelRef* pr) {
203 fBitmap.setPixelRef(pr, offset); 203 fBitmap.setPixelRef(pr);
204 return pr; 204 return pr;
205 } 205 }
206 206
207 #if 0
208 SkPixelRef* setPixelRef(SkPixelRef* pr, int dx, int dy) {
209 fBitmap.setPixelRef(pr, dx, dy);
210 return pr;
211 }
212 #endif
207 /** 213 /**
208 * Implements readPixels API. The caller will ensure that: 214 * Implements readPixels API. The caller will ensure that:
209 * 1. bitmap has pixel config kARGB_8888_Config. 215 * 1. bitmap has pixel config kARGB_8888_Config.
210 * 2. bitmap has pixels. 216 * 2. bitmap has pixels.
211 * 3. The rectangle (x, y, x + bitmap->width(), y + bitmap->height()) is 217 * 3. The rectangle (x, y, x + bitmap->width(), y + bitmap->height()) is
212 * contained in the device bounds. 218 * contained in the device bounds.
213 */ 219 */
214 virtual bool onReadPixels(const SkBitmap& bitmap, 220 virtual bool onReadPixels(const SkBitmap& bitmap,
215 int x, int y, 221 int x, int y,
216 SkCanvas::Config8888 config8888) SK_OVERRIDE; 222 SkCanvas::Config8888 config8888) SK_OVERRIDE;
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 /** Causes any deferred drawing to the device to be completed. 282 /** Causes any deferred drawing to the device to be completed.
277 */ 283 */
278 virtual void flush() SK_OVERRIDE {} 284 virtual void flush() SK_OVERRIDE {}
279 285
280 SkBitmap fBitmap; 286 SkBitmap fBitmap;
281 287
282 typedef SkBaseDevice INHERITED; 288 typedef SkBaseDevice INHERITED;
283 }; 289 };
284 290
285 #endif // SkBitmapDevice_DEFINED 291 #endif // SkBitmapDevice_DEFINED
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698