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 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 DrawingMgr fDrawingMgr; | 454 DrawingMgr fDrawingMgr; |
455 | 455 |
456 void initMockContext(); | 456 void initMockContext(); |
457 void initCommon(); | 457 void initCommon(); |
458 | 458 |
459 /** | 459 /** |
460 * These functions create premul <-> unpremul effects if it is possible to g
enerate a pair | 460 * These functions create premul <-> unpremul effects if it is possible to g
enerate a pair |
461 * of effects that make a readToUPM->writeToPM->readToUPM cycle invariant. O
therwise, they | 461 * of effects that make a readToUPM->writeToPM->readToUPM cycle invariant. O
therwise, they |
462 * return NULL. | 462 * return NULL. |
463 */ | 463 */ |
464 const GrFragmentProcessor* createPMToUPMEffect(GrProcessorDataManager*, GrTe
xture*, | 464 const GrFragmentProcessor* createPMToUPMEffect(GrTexture*, bool swapRAndB, |
465 bool swapRAndB, const SkMatri
x&) const; | 465 const SkMatrix&) const; |
466 const GrFragmentProcessor* createUPMToPMEffect(GrProcessorDataManager*, GrTe
xture*, | 466 const GrFragmentProcessor* createUPMToPMEffect(GrTexture*, bool swapRAndB, |
467 bool swapRAndB, const SkMatri
x&) const; | 467 const SkMatrix&) const; |
468 /** Called before either of the above two functions to determine the appropr
iate fragment | 468 /** Called before either of the above two functions to determine the appropr
iate fragment |
469 processors for conversions. This must be called by readSurfacePixels bef
or a mutex is taken, | 469 processors for conversions. This must be called by readSurfacePixels bef
ore a mutex is |
470 since testingvPM conversions itself will call readSurfacePixels */ | 470 taken, since testingvPM conversions itself will call readSurfacePixels *
/ |
471 void testPMConversionsIfNecessary(uint32_t flags); | 471 void testPMConversionsIfNecessary(uint32_t flags); |
472 /** Returns true if we've already determined that createPMtoUPMEffect and cr
eateUPMToPMEffect | 472 /** Returns true if we've already determined that createPMtoUPMEffect and cr
eateUPMToPMEffect |
473 will fail. In such cases fall back to SW conversion. */ | 473 will fail. In such cases fall back to SW conversion. */ |
474 bool didFailPMUPMConversionTest() const; | 474 bool didFailPMUPMConversionTest() const; |
475 | 475 |
476 /** | 476 /** |
477 * This callback allows the resource cache to callback into the GrContext | 477 * This callback allows the resource cache to callback into the GrContext |
478 * when the cache is still over budget after a purge. | 478 * when the cache is still over budget after a purge. |
479 */ | 479 */ |
480 static void OverBudgetCB(void* data); | 480 static void OverBudgetCB(void* data); |
481 | 481 |
482 /** | 482 /** |
483 * A callback similar to the above for use by the TextBlobCache | 483 * A callback similar to the above for use by the TextBlobCache |
484 * TODO move textblob draw calls below context so we can use the call above. | 484 * TODO move textblob draw calls below context so we can use the call above. |
485 */ | 485 */ |
486 static void TextBlobCacheOverBudgetCB(void* data); | 486 static void TextBlobCacheOverBudgetCB(void* data); |
487 | 487 |
488 typedef SkRefCnt INHERITED; | 488 typedef SkRefCnt INHERITED; |
489 }; | 489 }; |
490 | 490 |
491 #endif | 491 #endif |
OLD | NEW |