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 1981 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1992 } | 1992 } |
1993 | 1993 |
1994 bool SkGpuDevice::EXPERIMENTAL_drawPicture(SkCanvas* mainCanvas, const SkPicture
* mainPicture, | 1994 bool SkGpuDevice::EXPERIMENTAL_drawPicture(SkCanvas* mainCanvas, const SkPicture
* mainPicture, |
1995 const SkMatrix* matrix, const SkPaint
* paint) { | 1995 const SkMatrix* matrix, const SkPaint
* paint) { |
1996 #ifndef SK_IGNORE_GPU_LAYER_HOISTING | 1996 #ifndef SK_IGNORE_GPU_LAYER_HOISTING |
1997 // todo: should handle this natively | 1997 // todo: should handle this natively |
1998 if (paint) { | 1998 if (paint) { |
1999 return false; | 1999 return false; |
2000 } | 2000 } |
2001 | 2001 |
2002 const SkBigPicture::AccelData* data = NULL; | 2002 SkPicture::AccelData::Key key = SkLayerInfo::ComputeKey(); |
2003 if (const SkBigPicture* bp = mainPicture->asSkBigPicture()) { | 2003 |
2004 data = bp->accelData(); | 2004 const SkPicture::AccelData* data = mainPicture->EXPERIMENTAL_getAccelData(ke
y); |
2005 } | |
2006 if (!data) { | 2005 if (!data) { |
2007 return false; | 2006 return false; |
2008 } | 2007 } |
2009 | 2008 |
2010 const SkLayerInfo *gpuData = static_cast<const SkLayerInfo*>(data); | 2009 const SkLayerInfo *gpuData = static_cast<const SkLayerInfo*>(data); |
2011 if (0 == gpuData->numBlocks()) { | 2010 if (0 == gpuData->numBlocks()) { |
2012 return false; | 2011 return false; |
2013 } | 2012 } |
2014 | 2013 |
2015 SkTDArray<GrHoistedLayer> atlasedNeedRendering, atlasedRecycled; | 2014 SkTDArray<GrHoistedLayer> atlasedNeedRendering, atlasedRecycled; |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2058 #endif | 2057 #endif |
2059 } | 2058 } |
2060 | 2059 |
2061 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { | 2060 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { |
2062 // We always return a transient cache, so it is freed after each | 2061 // We always return a transient cache, so it is freed after each |
2063 // filter traversal. | 2062 // filter traversal. |
2064 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); | 2063 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); |
2065 } | 2064 } |
2066 | 2065 |
2067 #endif | 2066 #endif |
OLD | NEW |