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

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

Issue 1784563002: unify peekPixels around pixmap parameter (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update GrUploadPixmapToTexture to know about the new desc if readPixels was called Created 4 years, 9 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
« no previous file with comments | « gm/blend.cpp ('k') | include/core/SkImage.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 * 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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 * canvas (or its parent surface if any) will invalidate the 205 * canvas (or its parent surface if any) will invalidate the
206 * returned address (and associated information). 206 * returned address (and associated information).
207 * 207 *
208 * On failure, returns NULL and the info, rowBytes, and origin parameters a re ignored. 208 * On failure, returns NULL and the info, rowBytes, and origin parameters a re ignored.
209 */ 209 */
210 void* accessTopLayerPixels(SkImageInfo* info, size_t* rowBytes, SkIPoint* or igin = NULL); 210 void* accessTopLayerPixels(SkImageInfo* info, size_t* rowBytes, SkIPoint* or igin = NULL);
211 211
212 /** 212 /**
213 * If the canvas has readable pixels in its base layer (and is not recordin g to a picture 213 * If the canvas has readable pixels in its base layer (and is not recordin g to a picture
214 * or other non-raster target) and has direct access to its pixels (i.e. th ey are in 214 * or other non-raster target) and has direct access to its pixels (i.e. th ey are in
215 * local RAM) return the const-address of those pixels, and if not null, 215 * local RAM) return true, and if not null, return in the pixmap parameter information about
216 * return the ImageInfo and rowBytes. The returned address is only valid 216 * the pixels. The pixmap's pixel address is only valid
217 * while the canvas object is in scope and unchanged. Any API calls made on 217 * while the canvas object is in scope and unchanged. Any API calls made on
218 * canvas (or its parent surface if any) will invalidate the 218 * canvas (or its parent surface if any) will invalidate the pixel address
219 * returned address (and associated information). 219 * (and associated information).
220 * 220 *
221 * On failure, returns NULL and the info and rowBytes parameters are 221 * On failure, returns false and the pixmap parameter will be ignored.
222 * ignored.
223 */ 222 */
223 bool peekPixels(SkPixmap*);
224
225 #ifdef SK_SUPPORT_LEGACY_PEEKPIXELS_PARMS
224 const void* peekPixels(SkImageInfo* info, size_t* rowBytes); 226 const void* peekPixels(SkImageInfo* info, size_t* rowBytes);
227 #endif
225 228
226 /** 229 /**
227 * Copy the pixels from the base-layer into the specified buffer (pixels + rowBytes), 230 * Copy the pixels from the base-layer into the specified buffer (pixels + rowBytes),
228 * converting them into the requested format (SkImageInfo). The base-layer pixels are read 231 * converting them into the requested format (SkImageInfo). The base-layer pixels are read
229 * starting at the specified (srcX,srcY) location in the coordinate system of the base-layer. 232 * starting at the specified (srcX,srcY) location in the coordinate system of the base-layer.
230 * 233 *
231 * The specified ImageInfo and (srcX,srcY) offset specifies a source rectan gle 234 * The specified ImageInfo and (srcX,srcY) offset specifies a source rectan gle
232 * 235 *
233 * srcR.setXYWH(srcX, srcY, dstInfo.width(), dstInfo.height()); 236 * srcR.setXYWH(srcX, srcY, dstInfo.width(), dstInfo.height());
234 * 237 *
(...skipping 1274 matching lines...) Expand 10 before | Expand all | Expand 10 after
1509 1512
1510 class SkCanvasClipVisitor { 1513 class SkCanvasClipVisitor {
1511 public: 1514 public:
1512 virtual ~SkCanvasClipVisitor(); 1515 virtual ~SkCanvasClipVisitor();
1513 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0; 1516 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0;
1514 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0; 1517 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0;
1515 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0; 1518 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0;
1516 }; 1519 };
1517 1520
1518 #endif 1521 #endif
OLDNEW
« no previous file with comments | « gm/blend.cpp ('k') | include/core/SkImage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698