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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 * If the requested surface cannot be created, or the request is not a | 69 * If the requested surface cannot be created, or the request is not a |
70 * supported configuration, NULL will be returned. | 70 * supported configuration, NULL will be returned. |
71 */ | 71 */ |
72 static SkSurface* NewRaster(const SkImageInfo&, const SkSurfaceProps* = NULL
); | 72 static SkSurface* NewRaster(const SkImageInfo&, const SkSurfaceProps* = NULL
); |
73 | 73 |
74 /** | 74 /** |
75 * Helper version of NewRaster. It creates a SkImageInfo with the | 75 * Helper version of NewRaster. It creates a SkImageInfo with the |
76 * specified width and height, and populates the rest of info to match | 76 * specified width and height, and populates the rest of info to match |
77 * pixels in SkPMColor format. | 77 * pixels in SkPMColor format. |
78 */ | 78 */ |
79 #ifdef SK_SUPPORT_LEGACY_NewRasterPMColor | |
80 static SkSurface* NewRasterPMColor(int width, int height, const SkSurfacePro
ps* props = NULL) { | |
81 return NewRaster(SkImageInfo::MakeN32Premul(width, height), props); | |
82 } | |
83 #endif | |
84 static SkSurface* NewRasterN32Premul(int width, int height, const SkSurfaceP
rops* props = NULL) { | 79 static SkSurface* NewRasterN32Premul(int width, int height, const SkSurfaceP
rops* props = NULL) { |
85 return NewRaster(SkImageInfo::MakeN32Premul(width, height), props); | 80 return NewRaster(SkImageInfo::MakeN32Premul(width, height), props); |
86 } | 81 } |
87 | 82 |
88 /** | 83 /** |
89 * Return a new surface using the specified render target. | 84 * Return a new surface using the specified render target. |
90 */ | 85 */ |
91 static SkSurface* NewRenderTargetDirect(GrRenderTarget*, const SkSurfaceProp
s*); | 86 static SkSurface* NewRenderTargetDirect(GrRenderTarget*, const SkSurfaceProp
s*); |
92 | 87 |
93 static SkSurface* NewRenderTargetDirect(GrRenderTarget* target) { | 88 static SkSurface* NewRenderTargetDirect(GrRenderTarget* target) { |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 private: | 231 private: |
237 const SkSurfaceProps fProps; | 232 const SkSurfaceProps fProps; |
238 const int fWidth; | 233 const int fWidth; |
239 const int fHeight; | 234 const int fHeight; |
240 uint32_t fGenerationID; | 235 uint32_t fGenerationID; |
241 | 236 |
242 typedef SkRefCnt INHERITED; | 237 typedef SkRefCnt INHERITED; |
243 }; | 238 }; |
244 | 239 |
245 #endif | 240 #endif |
OLD | NEW |