| 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 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 629 const SkRect& maskRect, | 629 const SkRect& maskRect, |
| 630 const SkPath& devPath, | 630 const SkPath& devPath, |
| 631 const GrStrokeInfo& strokeInfo, | 631 const GrStrokeInfo& strokeInfo, |
| 632 bool doAA, | 632 bool doAA, |
| 633 GrAutoScratchTexture* mask, | 633 GrAutoScratchTexture* mask, |
| 634 int SampleCnt) { | 634 int SampleCnt) { |
| 635 GrTextureDesc desc; | 635 GrTextureDesc desc; |
| 636 desc.fFlags = kRenderTarget_GrTextureFlagBit; | 636 desc.fFlags = kRenderTarget_GrTextureFlagBit; |
| 637 desc.fWidth = SkScalarCeilToInt(maskRect.width()); | 637 desc.fWidth = SkScalarCeilToInt(maskRect.width()); |
| 638 desc.fHeight = SkScalarCeilToInt(maskRect.height()); | 638 desc.fHeight = SkScalarCeilToInt(maskRect.height()); |
| 639 desc.fSampleCnt = SampleCnt; | 639 desc.fSampleCnt = doAA ? SampleCnt : 0; |
| 640 // We actually only need A8, but it often isn't supported as a | 640 // We actually only need A8, but it often isn't supported as a |
| 641 // render target so default to RGBA_8888 | 641 // render target so default to RGBA_8888 |
| 642 desc.fConfig = kRGBA_8888_GrPixelConfig; | 642 desc.fConfig = kRGBA_8888_GrPixelConfig; |
| 643 | 643 |
| 644 if (context->isConfigRenderable(kAlpha_8_GrPixelConfig, | 644 if (context->isConfigRenderable(kAlpha_8_GrPixelConfig, |
| 645 desc.fSampleCnt > 0)) { | 645 desc.fSampleCnt > 0)) { |
| 646 desc.fConfig = kAlpha_8_GrPixelConfig; | 646 desc.fConfig = kAlpha_8_GrPixelConfig; |
| 647 } | 647 } |
| 648 | 648 |
| 649 mask->set(context, desc); | 649 mask->set(context, desc); |
| (...skipping 1210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1860 GrLayerHoister::UnlockLayers(fContext->getLayerCache(), atlased, nonAtlased,
recycled); | 1860 GrLayerHoister::UnlockLayers(fContext->getLayerCache(), atlased, nonAtlased,
recycled); |
| 1861 | 1861 |
| 1862 return true; | 1862 return true; |
| 1863 } | 1863 } |
| 1864 | 1864 |
| 1865 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { | 1865 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { |
| 1866 // We always return a transient cache, so it is freed after each | 1866 // We always return a transient cache, so it is freed after each |
| 1867 // filter traversal. | 1867 // filter traversal. |
| 1868 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); | 1868 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); |
| 1869 } | 1869 } |
| OLD | NEW |