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