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

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
« no previous file with comments | « include/core/SkBitmap.h ('k') | include/core/SkPicture.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 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 /** 207 /**
208 * Implements readPixels API. The caller will ensure that: 208 * Implements readPixels API. The caller will ensure that:
209 * 1. bitmap has pixel config kARGB_8888_Config. 209 * 1. bitmap has pixel config kARGB_8888_Config.
210 * 2. bitmap has pixels. 210 * 2. bitmap has pixels.
211 * 3. The rectangle (x, y, x + bitmap->width(), y + bitmap->height()) is 211 * 3. The rectangle (x, y, x + bitmap->width(), y + bitmap->height()) is
212 * contained in the device bounds. 212 * contained in the device bounds.
213 */ 213 */
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 /** Causes any deferred drawing to the device to be completed. 276 /** Causes any deferred drawing to the device to be completed.
277 */ 277 */
278 virtual void flush() SK_OVERRIDE {} 278 virtual void flush() SK_OVERRIDE {}
279 279
280 SkBitmap fBitmap; 280 SkBitmap fBitmap;
281 281
282 typedef SkBaseDevice INHERITED; 282 typedef SkBaseDevice INHERITED;
283 }; 283 };
284 284
285 #endif // SkBitmapDevice_DEFINED 285 #endif // SkBitmapDevice_DEFINED
OLDNEW
« no previous file with comments | « include/core/SkBitmap.h ('k') | include/core/SkPicture.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698