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

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

Issue 1643873002: allow the caller to specified raster-surface rowbytes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 10 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 | « no previous file | src/image/SkSurface_Raster.cpp » ('j') | src/image/SkSurface_Raster.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
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 SkSurface_DEFINED 8 #ifndef SkSurface_DEFINED
9 #define SkSurface_DEFINED 9 #define SkSurface_DEFINED
10 10
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 54
55 /** 55 /**
56 * The same as NewRasterDirect, but also accepts a call-back routine, which is invoked 56 * The same as NewRasterDirect, but also accepts a call-back routine, which is invoked
57 * when the surface is deleted, and is passed the pixel memory and the spec ified context. 57 * when the surface is deleted, and is passed the pixel memory and the spec ified context.
58 */ 58 */
59 static SkSurface* NewRasterDirectReleaseProc(const SkImageInfo&, void* pixel s, size_t rowBytes, 59 static SkSurface* NewRasterDirectReleaseProc(const SkImageInfo&, void* pixel s, size_t rowBytes,
60 void (*releaseProc)(void* pixel s, void* context), 60 void (*releaseProc)(void* pixel s, void* context),
61 void* context, const SkSurfaceP rops* = NULL); 61 void* context, const SkSurfaceP rops* = NULL);
62 62
63 /** 63 /**
64 * Return a new surface, with the memory for the pixels automatically 64 * Return a new surface, with the memory for the pixels automatically alloc ated, but respecting
65 * allocated. 65 * the specified rowBytes. If rowBytes==0, then a default value will be cho sen.
66 * 66 *
67 * If the requested surface cannot be created, or the request is not a 67 * If the requested surface cannot be created, or the request is not a
68 * supported configuration, NULL will be returned. 68 * supported configuration, NULL will be returned.
69 */ 69 */
70 static SkSurface* NewRaster(const SkImageInfo&, size_t rowBytes, const SkSur faceProps*);
71
72 /**
73 * Allocate a new surface, automatically computing the rowBytes.
74 */
70 static SkSurface* NewRaster(const SkImageInfo&, const SkSurfaceProps* = NULL ); 75 static SkSurface* NewRaster(const SkImageInfo&, const SkSurfaceProps* = NULL );
71 76
72 /** 77 /**
73 * Helper version of NewRaster. It creates a SkImageInfo with the 78 * Helper version of NewRaster. It creates a SkImageInfo with the
74 * specified width and height, and populates the rest of info to match 79 * specified width and height, and populates the rest of info to match
75 * pixels in SkPMColor format. 80 * pixels in SkPMColor format.
76 */ 81 */
77 static SkSurface* NewRasterN32Premul(int width, int height, const SkSurfaceP rops* props = NULL) { 82 static SkSurface* NewRasterN32Premul(int width, int height, const SkSurfaceP rops* props = NULL) {
78 return NewRaster(SkImageInfo::MakeN32Premul(width, height), props); 83 return NewRaster(SkImageInfo::MakeN32Premul(width, height), props);
79 } 84 }
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 private: 286 private:
282 const SkSurfaceProps fProps; 287 const SkSurfaceProps fProps;
283 const int fWidth; 288 const int fWidth;
284 const int fHeight; 289 const int fHeight;
285 uint32_t fGenerationID; 290 uint32_t fGenerationID;
286 291
287 typedef SkRefCnt INHERITED; 292 typedef SkRefCnt INHERITED;
288 }; 293 };
289 294
290 #endif 295 #endif
OLDNEW
« no previous file with comments | « no previous file | src/image/SkSurface_Raster.cpp » ('j') | src/image/SkSurface_Raster.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698