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 1804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1815 return NULL; | 1815 return NULL; |
1816 } | 1816 } |
1817 } | 1817 } |
1818 | 1818 |
1819 SkSurface* SkGpuDevice::newSurface(const SkImageInfo& info, const SkSurfaceProps
& props) { | 1819 SkSurface* SkGpuDevice::newSurface(const SkImageInfo& info, const SkSurfaceProps
& props) { |
1820 return SkSurface::NewRenderTarget(fContext, info, fRenderTarget->numSamples(
), &props); | 1820 return SkSurface::NewRenderTarget(fContext, info, fRenderTarget->numSamples(
), &props); |
1821 } | 1821 } |
1822 | 1822 |
1823 bool SkGpuDevice::EXPERIMENTAL_drawPicture(SkCanvas* mainCanvas, const SkPicture
* mainPicture, | 1823 bool SkGpuDevice::EXPERIMENTAL_drawPicture(SkCanvas* mainCanvas, const SkPicture
* mainPicture, |
1824 const SkMatrix* matrix, const SkPaint
* paint) { | 1824 const SkMatrix* matrix, const SkPaint
* paint) { |
| 1825 #ifndef SK_IGNORE_GPU_LAYER_HOISTING |
1825 // todo: should handle this natively | 1826 // todo: should handle this natively |
1826 if (paint) { | 1827 if (paint) { |
1827 return false; | 1828 return false; |
1828 } | 1829 } |
1829 | 1830 |
1830 SkPicture::AccelData::Key key = SkLayerInfo::ComputeKey(); | 1831 SkPicture::AccelData::Key key = SkLayerInfo::ComputeKey(); |
1831 | 1832 |
1832 const SkPicture::AccelData* data = mainPicture->EXPERIMENTAL_getAccelData(ke
y); | 1833 const SkPicture::AccelData* data = mainPicture->EXPERIMENTAL_getAccelData(ke
y); |
1833 if (!data) { | 1834 if (!data) { |
1834 return false; | 1835 return false; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1866 // Render the entire picture using new layers | 1867 // Render the entire picture using new layers |
1867 GrRecordReplaceDraw(mainPicture, mainCanvas, fContext->getLayerCache(), | 1868 GrRecordReplaceDraw(mainPicture, mainCanvas, fContext->getLayerCache(), |
1868 initialMatrix, NULL); | 1869 initialMatrix, NULL); |
1869 | 1870 |
1870 GrLayerHoister::UnlockLayers(fContext, needRendering); | 1871 GrLayerHoister::UnlockLayers(fContext, needRendering); |
1871 GrLayerHoister::UnlockLayers(fContext, recycled); | 1872 GrLayerHoister::UnlockLayers(fContext, recycled); |
1872 GrLayerHoister::UnlockLayers(fContext, atlasedNeedRendering); | 1873 GrLayerHoister::UnlockLayers(fContext, atlasedNeedRendering); |
1873 GrLayerHoister::UnlockLayers(fContext, atlasedRecycled); | 1874 GrLayerHoister::UnlockLayers(fContext, atlasedRecycled); |
1874 | 1875 |
1875 return true; | 1876 return true; |
| 1877 #else |
| 1878 return false; |
| 1879 #endif |
1876 } | 1880 } |
1877 | 1881 |
1878 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { | 1882 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { |
1879 // We always return a transient cache, so it is freed after each | 1883 // We always return a transient cache, so it is freed after each |
1880 // filter traversal. | 1884 // filter traversal. |
1881 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); | 1885 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); |
1882 } | 1886 } |
1883 | 1887 |
1884 #endif | 1888 #endif |
OLD | NEW |