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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 * Note: Scratch textures count against the GrContext's cached resource | 102 * Note: Scratch textures count against the GrContext's cached resource |
103 * budget. | 103 * budget. |
104 */ | 104 */ |
105 static SkSurface* NewScratchRenderTarget(GrContext*, const SkImageInfo&, int
sampleCount, | 105 static SkSurface* NewScratchRenderTarget(GrContext*, const SkImageInfo&, int
sampleCount, |
106 const SkSurfaceProps* = NULL); | 106 const SkSurfaceProps* = NULL); |
107 | 107 |
108 static SkSurface* NewScratchRenderTarget(GrContext* gr, const SkImageInfo& i
nfo) { | 108 static SkSurface* NewScratchRenderTarget(GrContext* gr, const SkImageInfo& i
nfo) { |
109 return NewScratchRenderTarget(gr, info, 0, NULL); | 109 return NewScratchRenderTarget(gr, info, 0, NULL); |
110 } | 110 } |
111 | 111 |
112 #ifdef SK_SUPPORT_LEGACY_TEXTRENDERMODE | |
113 /** | |
114 * Text rendering modes that can be passed to NewRenderTarget* | |
115 */ | |
116 enum TextRenderMode { | |
117 /** | |
118 * This will use the standard text rendering method | |
119 */ | |
120 kStandard_TextRenderMode, | |
121 /** | |
122 * This will use signed distance fields for text rendering when possibl
e | |
123 */ | |
124 kDistanceField_TextRenderMode, | |
125 }; | |
126 static SkSurface* NewRenderTargetDirect(GrRenderTarget*, TextRenderMode); | |
127 static SkSurface* NewRenderTarget(GrContext*, const SkImageInfo&, int sample
Count, | |
128 TextRenderMode); | |
129 static SkSurface* NewScratchRenderTarget(GrContext*, const SkImageInfo&, int
sampleCount, | |
130 TextRenderMode); | |
131 #endif | |
132 | |
133 int width() const { return fWidth; } | 112 int width() const { return fWidth; } |
134 int height() const { return fHeight; } | 113 int height() const { return fHeight; } |
135 | 114 |
136 /** | 115 /** |
137 * Returns a unique non-zero, unique value identifying the content of this | 116 * Returns a unique non-zero, unique value identifying the content of this |
138 * surface. Each time the content is changed changed, either by drawing | 117 * surface. Each time the content is changed changed, either by drawing |
139 * into this surface, or explicitly calling notifyContentChanged()) this | 118 * into this surface, or explicitly calling notifyContentChanged()) this |
140 * method will return a new value. | 119 * method will return a new value. |
141 * | 120 * |
142 * If this surface is empty (i.e. has a zero-dimention), this will return | 121 * If this surface is empty (i.e. has a zero-dimention), this will return |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 private: | 231 private: |
253 const SkSurfaceProps fProps; | 232 const SkSurfaceProps fProps; |
254 const int fWidth; | 233 const int fWidth; |
255 const int fHeight; | 234 const int fHeight; |
256 uint32_t fGenerationID; | 235 uint32_t fGenerationID; |
257 | 236 |
258 typedef SkRefCnt INHERITED; | 237 typedef SkRefCnt INHERITED; |
259 }; | 238 }; |
260 | 239 |
261 #endif | 240 #endif |
OLD | NEW |