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 1996 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2007 } | 2007 } |
2008 | 2008 |
2009 bool SkGpuDevice::EXPERIMENTAL_drawPicture(SkCanvas* mainCanvas, const SkPicture
* mainPicture, | 2009 bool SkGpuDevice::EXPERIMENTAL_drawPicture(SkCanvas* mainCanvas, const SkPicture
* mainPicture, |
2010 const SkMatrix* matrix, const SkPaint
* paint) { | 2010 const SkMatrix* matrix, const SkPaint
* paint) { |
2011 #ifndef SK_IGNORE_GPU_LAYER_HOISTING | 2011 #ifndef SK_IGNORE_GPU_LAYER_HOISTING |
2012 // todo: should handle this natively | 2012 // todo: should handle this natively |
2013 if (paint) { | 2013 if (paint) { |
2014 return false; | 2014 return false; |
2015 } | 2015 } |
2016 | 2016 |
2017 const SkBigPicture::AccelData* data = NULL; | 2017 SkPicture::AccelData::Key key = SkLayerInfo::ComputeKey(); |
2018 if (const SkBigPicture* bp = mainPicture->asSkBigPicture()) { | 2018 |
2019 data = bp->accelData(); | 2019 const SkPicture::AccelData* data = mainPicture->EXPERIMENTAL_getAccelData(ke
y); |
2020 } | |
2021 if (!data) { | 2020 if (!data) { |
2022 return false; | 2021 return false; |
2023 } | 2022 } |
2024 | 2023 |
2025 const SkLayerInfo *gpuData = static_cast<const SkLayerInfo*>(data); | 2024 const SkLayerInfo *gpuData = static_cast<const SkLayerInfo*>(data); |
2026 if (0 == gpuData->numBlocks()) { | 2025 if (0 == gpuData->numBlocks()) { |
2027 return false; | 2026 return false; |
2028 } | 2027 } |
2029 | 2028 |
2030 SkTDArray<GrHoistedLayer> atlasedNeedRendering, atlasedRecycled; | 2029 SkTDArray<GrHoistedLayer> atlasedNeedRendering, atlasedRecycled; |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2073 #endif | 2072 #endif |
2074 } | 2073 } |
2075 | 2074 |
2076 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { | 2075 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { |
2077 // We always return a transient cache, so it is freed after each | 2076 // We always return a transient cache, so it is freed after each |
2078 // filter traversal. | 2077 // filter traversal. |
2079 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); | 2078 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); |
2080 } | 2079 } |
2081 | 2080 |
2082 #endif | 2081 #endif |
OLD | NEW |