| 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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 * Can non-power-of-two textures be used with tile modes other than clamp? | 172 * Can non-power-of-two textures be used with tile modes other than clamp? |
| 173 */ | 173 */ |
| 174 bool npotTextureTileSupport() const; | 174 bool npotTextureTileSupport() const; |
| 175 | 175 |
| 176 /** | 176 /** |
| 177 * Return the max width or height of a texture supported by the current GPU
. | 177 * Return the max width or height of a texture supported by the current GPU
. |
| 178 */ | 178 */ |
| 179 int getMaxTextureSize() const; | 179 int getMaxTextureSize() const; |
| 180 | 180 |
| 181 /** | 181 /** |
| 182 * Temporarily override the true max texture size. Note: an override | |
| 183 * larger then the true max texture size will have no effect. | |
| 184 * This entry point is mainly meant for testing texture size dependent | |
| 185 * features and is only available if defined outside of Skia (see | |
| 186 * bleed GM. | |
| 187 */ | |
| 188 void setMaxTextureSizeOverride(int maxTextureSizeOverride); | |
| 189 | |
| 190 /** | |
| 191 * Can the provided configuration act as a color render target? | 182 * Can the provided configuration act as a color render target? |
| 192 */ | 183 */ |
| 193 bool isConfigRenderable(GrPixelConfig config, bool withMSAA) const; | 184 bool isConfigRenderable(GrPixelConfig config, bool withMSAA) const; |
| 194 | 185 |
| 195 /** | 186 /** |
| 196 * Return the max width or height of a render target supported by the | 187 * Return the max width or height of a render target supported by the |
| 197 * current GPU. | 188 * current GPU. |
| 198 */ | 189 */ |
| 199 int getMaxRenderTargetSize() const; | 190 int getMaxRenderTargetSize() const; |
| 200 | 191 |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 int fPMToUPMConversion; | 413 int fPMToUPMConversion; |
| 423 int fUPMToPMConversion; | 414 int fUPMToPMConversion; |
| 424 | 415 |
| 425 struct CleanUpData { | 416 struct CleanUpData { |
| 426 PFCleanUpFunc fFunc; | 417 PFCleanUpFunc fFunc; |
| 427 void* fInfo; | 418 void* fInfo; |
| 428 }; | 419 }; |
| 429 | 420 |
| 430 SkTDArray<CleanUpData> fCleanUpData; | 421 SkTDArray<CleanUpData> fCleanUpData; |
| 431 | 422 |
| 432 int fMaxTextureSizeOverride; | |
| 433 | |
| 434 const uint32_t fUniqueID; | 423 const uint32_t fUniqueID; |
| 435 | 424 |
| 436 GrContext(); // init must be called after the constructor. | 425 GrContext(); // init must be called after the constructor. |
| 437 bool init(GrBackend, GrBackendContext, const GrContextOptions& options); | 426 bool init(GrBackend, GrBackendContext, const GrContextOptions& options); |
| 438 | 427 |
| 439 // Currently the DrawingMgr just wraps the single GrDrawTarget in a single | 428 // Currently the DrawingMgr just wraps the single GrDrawTarget in a single |
| 440 // GrDrawContext and hands it out. In the future this class will allocate | 429 // GrDrawContext and hands it out. In the future this class will allocate |
| 441 // a new GrDrawContext for each GrRenderTarget/GrDrawTarget and manage | 430 // a new GrDrawContext for each GrRenderTarget/GrDrawTarget and manage |
| 442 // the DAG. | 431 // the DAG. |
| 443 class DrawingMgr { | 432 class DrawingMgr { |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 */ | 498 */ |
| 510 static void TextBlobCacheOverBudgetCB(void* data); | 499 static void TextBlobCacheOverBudgetCB(void* data); |
| 511 | 500 |
| 512 // TODO see note on createTextContext | 501 // TODO see note on createTextContext |
| 513 friend class SkGpuDevice; | 502 friend class SkGpuDevice; |
| 514 | 503 |
| 515 typedef SkRefCnt INHERITED; | 504 typedef SkRefCnt INHERITED; |
| 516 }; | 505 }; |
| 517 | 506 |
| 518 #endif | 507 #endif |
| OLD | NEW |