diff options
author | 2016-08-18 14:29:22 -0700 | |
---|---|---|
committer | 2016-08-18 14:29:22 -0700 | |
commit | 7fc08585d0d4daada1c8600b6cdef970ee6c2369 (patch) | |
tree | 0b39ac90f0f21f4496efef50c5fff1aed1f3302c /src/gpu/SkGpuDevice.cpp | |
parent | 530032a18e373ee673ae96fdbfa1fae6292f8f08 (diff) |
Revert of Batched implementation of drawLattice() for GPU (patchset #7 id:180001 of https://codereview.chromium.org/2255963002/ )
Reason for revert:
Things drawing weird.
Original issue's description:
> Batched implementation of drawLattice() for GPU
>
> Bechmarks (Nexus 6P):
>
> Src=100x100, Dst=250x250, NumRects=9
> Android 77.7us
> Skia (without patch) 57.2us
> Skia (with patch) 34.7us
>
> Src=100x100, Dst=500x500, NumRects=9
> Android 77.0us
> Skia (without patch) 56.9us
> Skia (with patch) 44.5us
>
> Src=100x100, Dst=1000x1000, NumRects=9
> Android 180us
> Skia (without patch) 96.8us
> Skia (with patch) 70.5us
>
> Src=100x100, Dst=250x250, NumRects=15
> Android 208us
> Skia (without patch) 155us
> Skia (with patch) 55.9us
>
> Src=100x100, Dst=500x500, NumRects=15
> Android 207us
> Skia (without patch) 152us
> Skia (with patch) 63.0us
>
> Src=100x100, Dst=1000x1000, NumRects=15
> Android 233us
> Skia (without patch) 156us
> Skia (with patch) 99.9us
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2255963002
>
> Committed: https://skia.googlesource.com/skia/+/93242c4ae50dfcc0d922cdb3ba80bbc7b4bbe93d
TBR=bsalomon@google.com,reed@google.com,djsollen@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:
Review-Url: https://codereview.chromium.org/2255683004
Diffstat (limited to 'src/gpu/SkGpuDevice.cpp')
-rw-r--r-- | src/gpu/SkGpuDevice.cpp | 61 |
1 files changed, 2 insertions, 59 deletions
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp index 040833b731..376d5e1b57 100644 --- a/src/gpu/SkGpuDevice.cpp +++ b/src/gpu/SkGpuDevice.cpp @@ -1409,10 +1409,8 @@ void SkGpuDevice::drawProducerNine(const SkDraw& draw, GrTextureProducer* produc return; } - std::unique_ptr<SkLatticeIter> iter( - new SkLatticeIter(producer->width(), producer->height(), center, dst)); - fDrawContext->drawImageLattice(fClip, grPaint, *draw.fMatrix, producer->width(), - producer->height(), std::move(iter), dst); + fDrawContext->drawImageNine(fClip, grPaint, *draw.fMatrix, producer->width(), + producer->height(), center, dst); } void SkGpuDevice::drawImageNine(const SkDraw& draw, const SkImage* image, @@ -1442,61 +1440,6 @@ void SkGpuDevice::drawBitmapNine(const SkDraw& draw, const SkBitmap& bitmap, con this->drawProducerNine(draw, &maker, center, dst, paint); } -void SkGpuDevice::drawProducerLattice(const SkDraw& draw, GrTextureProducer* producer, - const SkCanvas::Lattice& lattice, const SkRect& dst, - const SkPaint& paint) { - GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawProducerLattice", fContext); - - CHECK_SHOULD_DRAW(draw); - - static const GrTextureParams::FilterMode kMode = GrTextureParams::kNone_FilterMode; - sk_sp<GrFragmentProcessor> fp( - producer->createFragmentProcessor(SkMatrix::I(), - SkRect::MakeIWH(producer->width(), producer->height()), - GrTextureProducer::kNo_FilterConstraint, true, - &kMode, fDrawContext->getColorSpace(), - fDrawContext->sourceGammaTreatment())); - GrPaint grPaint; - if (!SkPaintToGrPaintWithTexture(this->context(), fDrawContext.get(), paint, *draw.fMatrix, - std::move(fp), producer->isAlphaOnly(), &grPaint)) { - return; - } - - std::unique_ptr<SkLatticeIter> iter( - new SkLatticeIter(producer->width(), producer->height(), lattice, dst)); - fDrawContext->drawImageLattice(fClip, grPaint, *draw.fMatrix, producer->width(), - producer->height(), std::move(iter), dst); -} - -void SkGpuDevice::drawImageLattice(const SkDraw& draw, const SkImage* image, - const SkCanvas::Lattice& lattice, const SkRect& dst, - const SkPaint& paint) { - ASSERT_SINGLE_OWNER - uint32_t pinnedUniqueID; - if (sk_sp<GrTexture> tex = as_IB(image)->refPinnedTexture(&pinnedUniqueID)) { - CHECK_SHOULD_DRAW(draw); - GrTextureAdjuster adjuster(tex.get(), image->alphaType(), image->bounds(), pinnedUniqueID, - as_IB(image)->onImageInfo().colorSpace()); - this->drawProducerLattice(draw, &adjuster, lattice, dst, paint); - } else { - SkBitmap bm; - if (SkImageCacherator* cacher = as_IB(image)->peekCacherator()) { - GrImageTextureMaker maker(fContext, cacher, image, SkImage::kAllow_CachingHint); - this->drawProducerLattice(draw, &maker, lattice, dst, paint); - } else if (as_IB(image)->getROPixels(&bm)) { - this->drawBitmapLattice(draw, bm, lattice, dst, paint); - } - } -} - -void SkGpuDevice::drawBitmapLattice(const SkDraw& draw, const SkBitmap& bitmap, - const SkCanvas::Lattice& lattice, const SkRect& dst, - const SkPaint& paint) { - ASSERT_SINGLE_OWNER - GrBitmapTextureMaker maker(fContext, bitmap); - this->drawProducerLattice(draw, &maker, lattice, dst, paint); -} - /////////////////////////////////////////////////////////////////////////////// // must be in SkCanvas::VertexMode order |