OLD | NEW |
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 Loading... |
54 * If the requested surface cannot be created, or the request is not a | 54 * If the requested surface cannot be created, or the request is not a |
55 * supported configuration, NULL will be returned. | 55 * supported configuration, NULL will be returned. |
56 */ | 56 */ |
57 static SkSurface* NewRaster(const SkImageInfo&, const SkSurfaceProps* = NULL
); | 57 static SkSurface* NewRaster(const SkImageInfo&, const SkSurfaceProps* = NULL
); |
58 | 58 |
59 /** | 59 /** |
60 * Helper version of NewRaster. It creates a SkImageInfo with the | 60 * Helper version of NewRaster. It creates a SkImageInfo with the |
61 * specified width and height, and populates the rest of info to match | 61 * specified width and height, and populates the rest of info to match |
62 * pixels in SkPMColor format. | 62 * pixels in SkPMColor format. |
63 */ | 63 */ |
| 64 #ifdef SK_SUPPORT_LEGACY_NewRasterPMColor |
64 static SkSurface* NewRasterPMColor(int width, int height, const SkSurfacePro
ps* props = NULL) { | 65 static SkSurface* NewRasterPMColor(int width, int height, const SkSurfacePro
ps* props = NULL) { |
65 return NewRaster(SkImageInfo::MakeN32Premul(width, height), props); | 66 return NewRaster(SkImageInfo::MakeN32Premul(width, height), props); |
66 } | 67 } |
| 68 #endif |
| 69 static SkSurface* NewRasterN32Premul(int width, int height, const SkSurfaceP
rops* props = NULL) { |
| 70 return NewRaster(SkImageInfo::MakeN32Premul(width, height), props); |
| 71 } |
67 | 72 |
68 /** | 73 /** |
69 * Return a new surface using the specified render target. | 74 * Return a new surface using the specified render target. |
70 */ | 75 */ |
71 static SkSurface* NewRenderTargetDirect(GrRenderTarget*, const SkSurfaceProp
s*); | 76 static SkSurface* NewRenderTargetDirect(GrRenderTarget*, const SkSurfaceProp
s*); |
72 | 77 |
73 static SkSurface* NewRenderTargetDirect(GrRenderTarget* target) { | 78 static SkSurface* NewRenderTargetDirect(GrRenderTarget* target) { |
74 return NewRenderTargetDirect(target, NULL); | 79 return NewRenderTargetDirect(target, NULL); |
75 } | 80 } |
76 | 81 |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 private: | 260 private: |
256 const SkSurfaceProps fProps; | 261 const SkSurfaceProps fProps; |
257 const int fWidth; | 262 const int fWidth; |
258 const int fHeight; | 263 const int fHeight; |
259 uint32_t fGenerationID; | 264 uint32_t fGenerationID; |
260 | 265 |
261 typedef SkRefCnt INHERITED; | 266 typedef SkRefCnt INHERITED; |
262 }; | 267 }; |
263 | 268 |
264 #endif | 269 #endif |
OLD | NEW |