| 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 1781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1792 return SkGpuDevice::Create( | 1792 return SkGpuDevice::Create( |
| 1793 texture->asRenderTarget(), cinfo.fInfo.width(), cinfo.fInfo.height()
, &props, init); | 1793 texture->asRenderTarget(), cinfo.fInfo.width(), cinfo.fInfo.height()
, &props, init); |
| 1794 } else { | 1794 } else { |
| 1795 SkErrorInternals::SetError( kInternalError_SkError, | 1795 SkErrorInternals::SetError( kInternalError_SkError, |
| 1796 "---- failed to create gpu device texture [%
d %d]\n", | 1796 "---- failed to create gpu device texture [%
d %d]\n", |
| 1797 cinfo.fInfo.width(), cinfo.fInfo.height()); | 1797 cinfo.fInfo.width(), cinfo.fInfo.height()); |
| 1798 return nullptr; | 1798 return nullptr; |
| 1799 } | 1799 } |
| 1800 } | 1800 } |
| 1801 | 1801 |
| 1802 SkSurface* SkGpuDevice::newSurface(const SkImageInfo& info, const SkSurfaceProps
& props) { | 1802 sk_sp<SkSurface> SkGpuDevice::makeSurface(const SkImageInfo& info, const SkSurfa
ceProps& props) { |
| 1803 ASSERT_SINGLE_OWNER | 1803 ASSERT_SINGLE_OWNER |
| 1804 // TODO: Change the signature of newSurface to take a budgeted parameter. | 1804 // TODO: Change the signature of newSurface to take a budgeted parameter. |
| 1805 static const SkBudgeted kBudgeted = SkBudgeted::kNo; | 1805 static const SkBudgeted kBudgeted = SkBudgeted::kNo; |
| 1806 return SkSurface::NewRenderTarget(fContext, kBudgeted, info, fRenderTarget->
desc().fSampleCnt, | 1806 return SkSurface::MakeRenderTarget(fContext, kBudgeted, info, fRenderTarget-
>desc().fSampleCnt, |
| 1807 &props); | 1807 &props); |
| 1808 } | 1808 } |
| 1809 | 1809 |
| 1810 bool SkGpuDevice::EXPERIMENTAL_drawPicture(SkCanvas* mainCanvas, const SkPicture
* mainPicture, | 1810 bool SkGpuDevice::EXPERIMENTAL_drawPicture(SkCanvas* mainCanvas, const SkPicture
* mainPicture, |
| 1811 const SkMatrix* matrix, const SkPaint
* paint) { | 1811 const SkMatrix* matrix, const SkPaint
* paint) { |
| 1812 ASSERT_SINGLE_OWNER | 1812 ASSERT_SINGLE_OWNER |
| 1813 #ifndef SK_IGNORE_GPU_LAYER_HOISTING | 1813 #ifndef SK_IGNORE_GPU_LAYER_HOISTING |
| 1814 // todo: should handle this natively | 1814 // todo: should handle this natively |
| 1815 if (paint) { | 1815 if (paint) { |
| 1816 return false; | 1816 return false; |
| 1817 } | 1817 } |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1883 } | 1883 } |
| 1884 | 1884 |
| 1885 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { | 1885 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { |
| 1886 ASSERT_SINGLE_OWNER | 1886 ASSERT_SINGLE_OWNER |
| 1887 // We always return a transient cache, so it is freed after each | 1887 // We always return a transient cache, so it is freed after each |
| 1888 // filter traversal. | 1888 // filter traversal. |
| 1889 return SkGpuDevice::NewImageFilterCache(); | 1889 return SkGpuDevice::NewImageFilterCache(); |
| 1890 } | 1890 } |
| 1891 | 1891 |
| 1892 #endif | 1892 #endif |
| OLD | NEW |