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 "GrBlurUtils.h" | 10 #include "GrBlurUtils.h" |
(...skipping 1813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1824 return SkGpuDevice::Create( | 1824 return SkGpuDevice::Create( |
1825 texture->asRenderTarget(), cinfo.fInfo.width(), cinfo.fInfo.height()
, &props, init); | 1825 texture->asRenderTarget(), cinfo.fInfo.width(), cinfo.fInfo.height()
, &props, init); |
1826 } else { | 1826 } else { |
1827 SkErrorInternals::SetError( kInternalError_SkError, | 1827 SkErrorInternals::SetError( kInternalError_SkError, |
1828 "---- failed to create gpu device texture [%
d %d]\n", | 1828 "---- failed to create gpu device texture [%
d %d]\n", |
1829 cinfo.fInfo.width(), cinfo.fInfo.height()); | 1829 cinfo.fInfo.width(), cinfo.fInfo.height()); |
1830 return nullptr; | 1830 return nullptr; |
1831 } | 1831 } |
1832 } | 1832 } |
1833 | 1833 |
1834 SkSurface* SkGpuDevice::newSurface(const SkImageInfo& info, const SkSurfaceProps
& props) { | 1834 sk_sp<SkSurface> SkGpuDevice::makeSurface(const SkImageInfo& info, const SkSurfa
ceProps& props) { |
1835 ASSERT_SINGLE_OWNER | 1835 ASSERT_SINGLE_OWNER |
1836 // TODO: Change the signature of newSurface to take a budgeted parameter. | 1836 // TODO: Change the signature of newSurface to take a budgeted parameter. |
1837 static const SkBudgeted kBudgeted = SkBudgeted::kNo; | 1837 static const SkBudgeted kBudgeted = SkBudgeted::kNo; |
1838 return SkSurface::NewRenderTarget(fContext, kBudgeted, info, fRenderTarget->
desc().fSampleCnt, | 1838 return SkSurface::MakeRenderTarget(fContext, kBudgeted, info, fRenderTarget-
>desc().fSampleCnt, |
1839 &props); | 1839 &props); |
1840 } | 1840 } |
1841 | 1841 |
1842 bool SkGpuDevice::EXPERIMENTAL_drawPicture(SkCanvas* mainCanvas, const SkPicture
* mainPicture, | 1842 bool SkGpuDevice::EXPERIMENTAL_drawPicture(SkCanvas* mainCanvas, const SkPicture
* mainPicture, |
1843 const SkMatrix* matrix, const SkPaint
* paint) { | 1843 const SkMatrix* matrix, const SkPaint
* paint) { |
1844 ASSERT_SINGLE_OWNER | 1844 ASSERT_SINGLE_OWNER |
1845 #ifndef SK_IGNORE_GPU_LAYER_HOISTING | 1845 #ifndef SK_IGNORE_GPU_LAYER_HOISTING |
1846 // todo: should handle this natively | 1846 // todo: should handle this natively |
1847 if (paint) { | 1847 if (paint) { |
1848 return false; | 1848 return false; |
1849 } | 1849 } |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1915 } | 1915 } |
1916 | 1916 |
1917 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { | 1917 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { |
1918 ASSERT_SINGLE_OWNER | 1918 ASSERT_SINGLE_OWNER |
1919 // We always return a transient cache, so it is freed after each | 1919 // We always return a transient cache, so it is freed after each |
1920 // filter traversal. | 1920 // filter traversal. |
1921 return SkGpuDevice::NewImageFilterCache(); | 1921 return SkGpuDevice::NewImageFilterCache(); |
1922 } | 1922 } |
1923 | 1923 |
1924 #endif | 1924 #endif |
OLD | NEW |