| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 #include "SkGpuDevice.h" | 8 #include "SkGpuDevice.h" |
| 9 | 9 |
| 10 #include "effects/GrBicubicEffect.h" | 10 #include "effects/GrBicubicEffect.h" |
| (...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 651 GrTexture* mask = context->refScratchTexture(desc,GrContext::kApprox_Scratch
TexMatch); | 651 GrTexture* mask = context->refScratchTexture(desc,GrContext::kApprox_Scratch
TexMatch); |
| 652 if (NULL == mask) { | 652 if (NULL == mask) { |
| 653 return NULL; | 653 return NULL; |
| 654 } | 654 } |
| 655 | 655 |
| 656 SkRect clipRect = SkRect::MakeWH(maskRect.width(), maskRect.height()); | 656 SkRect clipRect = SkRect::MakeWH(maskRect.width(), maskRect.height()); |
| 657 | 657 |
| 658 GrContext::AutoRenderTarget art(context, mask->asRenderTarget()); | 658 GrContext::AutoRenderTarget art(context, mask->asRenderTarget()); |
| 659 GrContext::AutoClip ac(context, clipRect); | 659 GrContext::AutoClip ac(context, clipRect); |
| 660 | 660 |
| 661 context->clear(NULL, 0x0, true); | 661 context->clear(NULL, 0x0, true, mask->asRenderTarget()); |
| 662 | 662 |
| 663 GrPaint tempPaint; | 663 GrPaint tempPaint; |
| 664 if (doAA) { | 664 if (doAA) { |
| 665 tempPaint.setAntiAlias(true); | 665 tempPaint.setAntiAlias(true); |
| 666 // AA uses the "coverage" stages on GrDrawTarget. Coverage with a dst | 666 // AA uses the "coverage" stages on GrDrawTarget. Coverage with a dst |
| 667 // blend coeff of zero requires dual source blending support in order | 667 // blend coeff of zero requires dual source blending support in order |
| 668 // to properly blend partially covered pixels. This means the AA | 668 // to properly blend partially covered pixels. This means the AA |
| 669 // code path may not be taken. So we use a dst blend coeff of ISA. We | 669 // code path may not be taken. So we use a dst blend coeff of ISA. We |
| 670 // could special case AA draws to a dst surface with known alpha=0 to | 670 // could special case AA draws to a dst surface with known alpha=0 to |
| 671 // use a zero dst coeff when dual source blending isn't available. | 671 // use a zero dst coeff when dual source blending isn't available. |
| (...skipping 1180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1852 return true; | 1852 return true; |
| 1853 } | 1853 } |
| 1854 | 1854 |
| 1855 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { | 1855 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { |
| 1856 // We always return a transient cache, so it is freed after each | 1856 // We always return a transient cache, so it is freed after each |
| 1857 // filter traversal. | 1857 // filter traversal. |
| 1858 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); | 1858 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); |
| 1859 } | 1859 } |
| 1860 | 1860 |
| 1861 #endif | 1861 #endif |
| OLD | NEW |