| 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 "GrContext.h" | 10 #include "GrContext.h" |
| (...skipping 1967 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1978 } | 1978 } |
| 1979 | 1979 |
| 1980 bool SkGpuDevice::EXPERIMENTAL_drawPicture(SkCanvas* mainCanvas, const SkPicture
* mainPicture, | 1980 bool SkGpuDevice::EXPERIMENTAL_drawPicture(SkCanvas* mainCanvas, const SkPicture
* mainPicture, |
| 1981 const SkMatrix* matrix, const SkPaint
* paint) { | 1981 const SkMatrix* matrix, const SkPaint
* paint) { |
| 1982 #ifndef SK_IGNORE_GPU_LAYER_HOISTING | 1982 #ifndef SK_IGNORE_GPU_LAYER_HOISTING |
| 1983 // todo: should handle this natively | 1983 // todo: should handle this natively |
| 1984 if (paint) { | 1984 if (paint) { |
| 1985 return false; | 1985 return false; |
| 1986 } | 1986 } |
| 1987 | 1987 |
| 1988 SkPicture::AccelData::Key key = SkLayerInfo::ComputeKey(); | 1988 const SkBigPicture::AccelData* data = NULL; |
| 1989 | 1989 if (const SkBigPicture* bp = mainPicture->asSkBigPicture()) { |
| 1990 const SkPicture::AccelData* data = mainPicture->EXPERIMENTAL_getAccelData(ke
y); | 1990 data = bp->accelData(); |
| 1991 } |
| 1991 if (!data) { | 1992 if (!data) { |
| 1992 return false; | 1993 return false; |
| 1993 } | 1994 } |
| 1994 | 1995 |
| 1995 const SkLayerInfo *gpuData = static_cast<const SkLayerInfo*>(data); | 1996 const SkLayerInfo *gpuData = static_cast<const SkLayerInfo*>(data); |
| 1996 if (0 == gpuData->numBlocks()) { | 1997 if (0 == gpuData->numBlocks()) { |
| 1997 return false; | 1998 return false; |
| 1998 } | 1999 } |
| 1999 | 2000 |
| 2000 SkTDArray<GrHoistedLayer> atlasedNeedRendering, atlasedRecycled; | 2001 SkTDArray<GrHoistedLayer> atlasedNeedRendering, atlasedRecycled; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2043 #endif | 2044 #endif |
| 2044 } | 2045 } |
| 2045 | 2046 |
| 2046 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { | 2047 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { |
| 2047 // We always return a transient cache, so it is freed after each | 2048 // We always return a transient cache, so it is freed after each |
| 2048 // filter traversal. | 2049 // filter traversal. |
| 2049 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); | 2050 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); |
| 2050 } | 2051 } |
| 2051 | 2052 |
| 2052 #endif | 2053 #endif |
| OLD | NEW |