| 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 1482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1493 SkRect::MakeIWH(producer->width(), pro
ducer->height()), | 1493 SkRect::MakeIWH(producer->width(), pro
ducer->height()), |
| 1494 GrTextureProducer::kNo_FilterConstrain
t, true, | 1494 GrTextureProducer::kNo_FilterConstrain
t, true, |
| 1495 &kMode, fDrawContext->getColorSpace(), | 1495 &kMode, fDrawContext->getColorSpace(), |
| 1496 fDrawContext->sourceGammaTreatment()))
; | 1496 fDrawContext->sourceGammaTreatment()))
; |
| 1497 GrPaint grPaint; | 1497 GrPaint grPaint; |
| 1498 if (!SkPaintToGrPaintWithTexture(this->context(), fDrawContext.get(), paint,
*draw.fMatrix, | 1498 if (!SkPaintToGrPaintWithTexture(this->context(), fDrawContext.get(), paint,
*draw.fMatrix, |
| 1499 std::move(fp), producer->isAlphaOnly(), &gr
Paint)) { | 1499 std::move(fp), producer->isAlphaOnly(), &gr
Paint)) { |
| 1500 return; | 1500 return; |
| 1501 } | 1501 } |
| 1502 | 1502 |
| 1503 std::unique_ptr<SkLatticeIter> iter( | 1503 std::unique_ptr<SkLatticeIter> iter(new SkLatticeIter(lattice, dst)); |
| 1504 new SkLatticeIter(producer->width(), producer->height(), lattice, ds
t)); | |
| 1505 fDrawContext->drawImageLattice(fClip, grPaint, *draw.fMatrix, producer->widt
h(), | 1504 fDrawContext->drawImageLattice(fClip, grPaint, *draw.fMatrix, producer->widt
h(), |
| 1506 producer->height(), std::move(iter), dst); | 1505 producer->height(), std::move(iter), dst); |
| 1507 } | 1506 } |
| 1508 | 1507 |
| 1509 void SkGpuDevice::drawImageLattice(const SkDraw& draw, const SkImage* image, | 1508 void SkGpuDevice::drawImageLattice(const SkDraw& draw, const SkImage* image, |
| 1510 const SkCanvas::Lattice& lattice, const SkRec
t& dst, | 1509 const SkCanvas::Lattice& lattice, const SkRec
t& dst, |
| 1511 const SkPaint& paint) { | 1510 const SkPaint& paint) { |
| 1512 ASSERT_SINGLE_OWNER | 1511 ASSERT_SINGLE_OWNER |
| 1513 uint32_t pinnedUniqueID; | 1512 uint32_t pinnedUniqueID; |
| 1514 if (sk_sp<GrTexture> tex = as_IB(image)->refPinnedTexture(&pinnedUniqueID))
{ | 1513 if (sk_sp<GrTexture> tex = as_IB(image)->refPinnedTexture(&pinnedUniqueID))
{ |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1814 } | 1813 } |
| 1815 | 1814 |
| 1816 SkImageFilterCache* SkGpuDevice::getImageFilterCache() { | 1815 SkImageFilterCache* SkGpuDevice::getImageFilterCache() { |
| 1817 ASSERT_SINGLE_OWNER | 1816 ASSERT_SINGLE_OWNER |
| 1818 // We always return a transient cache, so it is freed after each | 1817 // We always return a transient cache, so it is freed after each |
| 1819 // filter traversal. | 1818 // filter traversal. |
| 1820 return SkImageFilterCache::Create(SkImageFilterCache::kDefaultTransientSize)
; | 1819 return SkImageFilterCache::Create(SkImageFilterCache::kDefaultTransientSize)
; |
| 1821 } | 1820 } |
| 1822 | 1821 |
| 1823 #endif | 1822 #endif |
| OLD | NEW |