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 1483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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( |
1504 new SkLatticeIter(producer->width(), producer->height(), lattice, ds
t)); | 1504 new SkLatticeIter(lattice, dst)); |
1505 fDrawContext->drawImageLattice(fClip, grPaint, *draw.fMatrix, producer->widt
h(), | 1505 fDrawContext->drawImageLattice(fClip, grPaint, *draw.fMatrix, producer->widt
h(), |
1506 producer->height(), std::move(iter), dst); | 1506 producer->height(), std::move(iter), dst); |
1507 } | 1507 } |
1508 | 1508 |
1509 void SkGpuDevice::drawImageLattice(const SkDraw& draw, const SkImage* image, | 1509 void SkGpuDevice::drawImageLattice(const SkDraw& draw, const SkImage* image, |
1510 const SkCanvas::Lattice& lattice, const SkRec
t& dst, | 1510 const SkCanvas::Lattice& lattice, const SkRec
t& dst, |
1511 const SkPaint& paint) { | 1511 const SkPaint& paint) { |
1512 ASSERT_SINGLE_OWNER | 1512 ASSERT_SINGLE_OWNER |
1513 uint32_t pinnedUniqueID; | 1513 uint32_t pinnedUniqueID; |
1514 if (sk_sp<GrTexture> tex = as_IB(image)->refPinnedTexture(&pinnedUniqueID))
{ | 1514 if (sk_sp<GrTexture> tex = as_IB(image)->refPinnedTexture(&pinnedUniqueID))
{ |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1814 } | 1814 } |
1815 | 1815 |
1816 SkImageFilterCache* SkGpuDevice::getImageFilterCache() { | 1816 SkImageFilterCache* SkGpuDevice::getImageFilterCache() { |
1817 ASSERT_SINGLE_OWNER | 1817 ASSERT_SINGLE_OWNER |
1818 // We always return a transient cache, so it is freed after each | 1818 // We always return a transient cache, so it is freed after each |
1819 // filter traversal. | 1819 // filter traversal. |
1820 return SkImageFilterCache::Create(SkImageFilterCache::kDefaultTransientSize)
; | 1820 return SkImageFilterCache::Create(SkImageFilterCache::kDefaultTransientSize)
; |
1821 } | 1821 } |
1822 | 1822 |
1823 #endif | 1823 #endif |
OLD | NEW |