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

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

Issue 830033003: change API contract: disallow zero-sized images or surfaces (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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
« no previous file with comments | « include/core/SkImage.h ('k') | src/image/SkImage_Raster.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 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
11 #include "SkRefCnt.h" 11 #include "SkRefCnt.h"
12 #include "SkImage.h" 12 #include "SkImage.h"
13 #include "SkSurfaceProps.h" 13 #include "SkSurfaceProps.h"
14 14
15 class SkCanvas; 15 class SkCanvas;
16 class SkPaint; 16 class SkPaint;
17 class GrContext; 17 class GrContext;
18 class GrRenderTarget; 18 class GrRenderTarget;
19 19
20 /** 20 /**
21 * SkSurface represents the backend/results of drawing to a canvas. For raster 21 * SkSurface represents the backend/results of drawing to a canvas. For raster
22 * drawing, the surface will be pixels, but (for example) when drawing into 22 * drawing, the surface will be pixels, but (for example) when drawing into
23 * a PDF or Picture canvas, the surface stores the recorded commands. 23 * a PDF or Picture canvas, the surface stores the recorded commands.
24 * 24 *
25 * To draw into a canvas, first create the appropriate type of Surface, and 25 * To draw into a canvas, first create the appropriate type of Surface, and
26 * then request the canvas from the surface. 26 * then request the canvas from the surface.
27 *
28 * SkSurface always has non-zero dimensions. If there is a request for a new su rface, and either
29 * of the requested dimensions are zero, then NULL will be returned.
27 */ 30 */
28 class SK_API SkSurface : public SkRefCnt { 31 class SK_API SkSurface : public SkRefCnt {
29 public: 32 public:
30 SK_DECLARE_INST_COUNT(SkSurface) 33 SK_DECLARE_INST_COUNT(SkSurface)
31 34
32 /** 35 /**
33 * Create a new surface, using the specified pixels/rowbytes as its 36 * Create a new surface, using the specified pixels/rowbytes as its
34 * backend. 37 * backend.
35 * 38 *
36 * If the requested surface cannot be created, or the request is not a 39 * If the requested surface cannot be created, or the request is not a
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 private: 234 private:
232 const SkSurfaceProps fProps; 235 const SkSurfaceProps fProps;
233 const int fWidth; 236 const int fWidth;
234 const int fHeight; 237 const int fHeight;
235 uint32_t fGenerationID; 238 uint32_t fGenerationID;
236 239
237 typedef SkRefCnt INHERITED; 240 typedef SkRefCnt INHERITED;
238 }; 241 };
239 242
240 #endif 243 #endif
OLDNEW
« no previous file with comments | « include/core/SkImage.h ('k') | src/image/SkImage_Raster.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698