| 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 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 bool init(GrBackend, GrBackendContext, const GrContextOptions& options); | 450 bool init(GrBackend, GrBackendContext, const GrContextOptions& options); |
| 451 | 451 |
| 452 void initMockContext(); | 452 void initMockContext(); |
| 453 void initCommon(const GrContextOptions&); | 453 void initCommon(const GrContextOptions&); |
| 454 | 454 |
| 455 /** | 455 /** |
| 456 * These functions create premul <-> unpremul effects if it is possible to g
enerate a pair | 456 * These functions create premul <-> unpremul effects if it is possible to g
enerate a pair |
| 457 * of effects that make a readToUPM->writeToPM->readToUPM cycle invariant. O
therwise, they | 457 * of effects that make a readToUPM->writeToPM->readToUPM cycle invariant. O
therwise, they |
| 458 * return NULL. They also can perform a swizzle as part of the draw. | 458 * return NULL. They also can perform a swizzle as part of the draw. |
| 459 */ | 459 */ |
| 460 const GrFragmentProcessor* createPMToUPMEffect(GrTexture*, const GrSwizzle&, | 460 sk_sp<GrFragmentProcessor> createPMToUPMEffect(GrTexture*, const GrSwizzle&, |
| 461 const SkMatrix&) const; | 461 const SkMatrix&) const; |
| 462 const GrFragmentProcessor* createUPMToPMEffect(GrTexture*, const GrSwizzle&, | 462 sk_sp<GrFragmentProcessor> createUPMToPMEffect(GrTexture*, const GrSwizzle&, |
| 463 const SkMatrix&) const; | 463 const SkMatrix&) const; |
| 464 /** Called before either of the above two functions to determine the appropr
iate fragment | 464 /** Called before either of the above two functions to determine the appropr
iate fragment |
| 465 processors for conversions. This must be called by readSurfacePixels bef
ore a mutex is | 465 processors for conversions. This must be called by readSurfacePixels bef
ore a mutex is |
| 466 taken, since testingvPM conversions itself will call readSurfacePixels *
/ | 466 taken, since testingvPM conversions itself will call readSurfacePixels *
/ |
| 467 void testPMConversionsIfNecessary(uint32_t flags); | 467 void testPMConversionsIfNecessary(uint32_t flags); |
| 468 /** Returns true if we've already determined that createPMtoUPMEffect and cr
eateUPMToPMEffect | 468 /** Returns true if we've already determined that createPMtoUPMEffect and cr
eateUPMToPMEffect |
| 469 will fail. In such cases fall back to SW conversion. */ | 469 will fail. In such cases fall back to SW conversion. */ |
| 470 bool didFailPMUPMConversionTest() const; | 470 bool didFailPMUPMConversionTest() const; |
| 471 | 471 |
| 472 /** | 472 /** |
| (...skipping 24 matching lines...) Expand all Loading... |
| 497 SkAutoTUnref<const GrCaps> fCaps; | 497 SkAutoTUnref<const GrCaps> fCaps; |
| 498 uint32_t fContextUniqueID; | 498 uint32_t fContextUniqueID; |
| 499 | 499 |
| 500 friend class GrContext; | 500 friend class GrContext; |
| 501 friend class SkImage; | 501 friend class SkImage; |
| 502 | 502 |
| 503 typedef SkRefCnt INHERITED; | 503 typedef SkRefCnt INHERITED; |
| 504 }; | 504 }; |
| 505 | 505 |
| 506 #endif | 506 #endif |
| OLD | NEW |