OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2010 Google Inc. | 2 * Copyright 2010 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 GrContext_DEFINED | 8 #ifndef GrContext_DEFINED |
9 #define GrContext_DEFINED | 9 #define GrContext_DEFINED |
10 | 10 |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 * current GPU. | 299 * current GPU. |
300 */ | 300 */ |
301 int getMaxRenderTargetSize() const; | 301 int getMaxRenderTargetSize() const; |
302 | 302 |
303 /** | 303 /** |
304 * Returns the max sample count for a render target. It will be 0 if MSAA | 304 * Returns the max sample count for a render target. It will be 0 if MSAA |
305 * is not supported. | 305 * is not supported. |
306 */ | 306 */ |
307 int getMaxSampleCount() const; | 307 int getMaxSampleCount() const; |
308 | 308 |
| 309 /** |
| 310 * Returns the recommended sample count for a render target when using this |
| 311 * context. |
| 312 * |
| 313 * @param config the configuration of the render target. |
| 314 * @param dpi the display density in dots per inch. |
| 315 * |
| 316 * @return sample count that should be perform well and have good enough |
| 317 * rendering quality for the display. Alternatively returns 0 if |
| 318 * MSAA is not supported or recommended to be used by default. |
| 319 */ |
| 320 int getRecommendedSampleCount(GrPixelConfig config, SkScalar dpi) const; |
| 321 |
309 /////////////////////////////////////////////////////////////////////////// | 322 /////////////////////////////////////////////////////////////////////////// |
310 // Backend Surfaces | 323 // Backend Surfaces |
311 | 324 |
312 /** | 325 /** |
313 * Wraps an existing texture with a GrTexture object. | 326 * Wraps an existing texture with a GrTexture object. |
314 * | 327 * |
315 * OpenGL: if the object is a texture Gr may change its GL texture params | 328 * OpenGL: if the object is a texture Gr may change its GL texture params |
316 * when it is drawn. | 329 * when it is drawn. |
317 * | 330 * |
318 * @param desc description of the object to create. | 331 * @param desc description of the object to create. |
(...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1044 } | 1057 } |
1045 | 1058 |
1046 GrTexture* texture() { return fTexture; } | 1059 GrTexture* texture() { return fTexture; } |
1047 | 1060 |
1048 private: | 1061 private: |
1049 GrContext* fContext; | 1062 GrContext* fContext; |
1050 GrTexture* fTexture; | 1063 GrTexture* fTexture; |
1051 }; | 1064 }; |
1052 | 1065 |
1053 #endif | 1066 #endif |
OLD | NEW |