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

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

Issue 244763004: add optional origin parameter to accessTopLayerPixels (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 8 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 | « no previous file | src/core/SkCanvas.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 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
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 SkCanvas_DEFINED 8 #ifndef SkCanvas_DEFINED
9 #define SkCanvas_DEFINED 9 #define SkCanvas_DEFINED
10 10
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 * For a canvas with non-GPU device, NULL is returned. 199 * For a canvas with non-GPU device, NULL is returned.
200 */ 200 */
201 GrContext* getGrContext(); 201 GrContext* getGrContext();
202 202
203 /////////////////////////////////////////////////////////////////////////// 203 ///////////////////////////////////////////////////////////////////////////
204 204
205 /** 205 /**
206 * If the canvas has writable pixels in its top layer (and is not recording to a picture 206 * If the canvas has writable pixels in its top layer (and is not recording to a picture
207 * or other non-raster target) and has direct access to its pixels (i.e. th ey are in 207 * or other non-raster target) and has direct access to its pixels (i.e. th ey are in
208 * local RAM) return the address of those pixels, and if not null, 208 * local RAM) return the address of those pixels, and if not null,
209 * return the ImageInfo and rowBytes. The returned address is only valid 209 * return the ImageInfo, rowBytes and origin. The returned address is only valid
210 * while the canvas object is in scope and unchanged. Any API calls made on 210 * while the canvas object is in scope and unchanged. Any API calls made on
211 * canvas (or its parent surface if any) will invalidate the 211 * canvas (or its parent surface if any) will invalidate the
212 * returned address (and associated information). 212 * returned address (and associated information).
213 * 213 *
214 * On failure, returns NULL and the info and rowBytes parameters are 214 * On failure, returns NULL and the info, rowBytes, and origin parameters a re ignored.
215 * ignored.
216 */ 215 */
217 void* accessTopLayerPixels(SkImageInfo* info, size_t* rowBytes); 216 void* accessTopLayerPixels(SkImageInfo* info, size_t* rowBytes, SkIPoint* or igin = NULL);
218 217
219 /** 218 /**
220 * If the canvas has readable pixels in its base layer (and is not recordin g to a picture 219 * If the canvas has readable pixels in its base layer (and is not recordin g to a picture
221 * or other non-raster target) and has direct access to its pixels (i.e. th ey are in 220 * or other non-raster target) and has direct access to its pixels (i.e. th ey are in
222 * local RAM) return the const-address of those pixels, and if not null, 221 * local RAM) return the const-address of those pixels, and if not null,
223 * return the ImageInfo and rowBytes. The returned address is only valid 222 * return the ImageInfo and rowBytes. The returned address is only valid
224 * while the canvas object is in scope and unchanged. Any API calls made on 223 * while the canvas object is in scope and unchanged. Any API calls made on
225 * canvas (or its parent surface if any) will invalidate the 224 * canvas (or its parent surface if any) will invalidate the
226 * returned address (and associated information). 225 * returned address (and associated information).
227 * 226 *
(...skipping 1208 matching lines...) Expand 10 before | Expand all | Expand 10 after
1436 bool asROBitmap(SkBitmap*) const; 1435 bool asROBitmap(SkBitmap*) const;
1437 1436
1438 private: 1437 private:
1439 SkBitmap fBitmap; // used if peekPixels() fails 1438 SkBitmap fBitmap; // used if peekPixels() fails
1440 const void* fAddr; // NULL on failure 1439 const void* fAddr; // NULL on failure
1441 SkImageInfo fInfo; 1440 SkImageInfo fInfo;
1442 size_t fRowBytes; 1441 size_t fRowBytes;
1443 }; 1442 };
1444 1443
1445 #endif 1444 #endif
OLDNEW
« no previous file with comments | « no previous file | src/core/SkCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698