From 3798c86f6885f0b47fb2e659a43b48a4468a97ef Mon Sep 17 00:00:00 2001 From: Robert Phillips Date: Mon, 27 Mar 2017 11:08:16 -0400 Subject: Remove GrFragmentProcessor-derived class' GrTexture-based ctors Split out into: https://skia-review.googlesource.com/c/8881/ (Switch GrTextureStripAtlas over to GrTextureProxies) https://skia-review.googlesource.com/c/8942/ (Wrap cached GrTextures in GrTextureProxies (e.g., blur profiles, nine-patch blurs, etc.)) https://skia-review.googlesource.com/c/8997/ (Clean up/remove unused GrFragmentProcessor-derived ctors) https://skia-review.googlesource.com/c/9191/ (Switch SkImageGenerator over to generating GrTextureProxies) https://skia-review.googlesource.com/c/9448/ (Switch GrYUVProvider over to GrTextureProxies) https://skia-review.googlesource.com/c/9559/ (Preparatory Proxification) https://skia-review.googlesource.com/c/9626/ (Consolidate Proxy caching code in GrResourceProvider) https://skia-review.googlesource.com/c/9683/ (More pre-emptive proxification) https://skia-review.googlesource.com/c/9917/ (Make experimental Perlin noise shader take texture proxies) https://skia-review.googlesource.com/c/9961/ (rename makeCopyForTextureParams to isACopyNeededForTextureParams) https://skia-review.googlesource.com/c/9945/ (Make SkImageCacherator be deferred) https://skia-review.googlesource.com/c/10180/ (Add new proxy-based DetermineDomainMode w/ test) Change-Id: Ia33389d92360e542a9d2bf395948deb04d017465 Reviewed-on: https://skia-review.googlesource.com/8823 Reviewed-by: Brian Salomon Commit-Queue: Robert Phillips --- src/gpu/SkGpuDevice.cpp | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) (limited to 'src/gpu/SkGpuDevice.cpp') diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp index 11134095ca..4e16d5965f 100644 --- a/src/gpu/SkGpuDevice.cpp +++ b/src/gpu/SkGpuDevice.cpp @@ -1370,11 +1370,12 @@ void SkGpuDevice::drawImage(const SkImage* image, SkScalar x, SkScalar y, SkMatrix viewMatrix = this->ctm(); viewMatrix.preTranslate(x, y); uint32_t pinnedUniqueID; - if (sk_sp tex = as_IB(image)->refPinnedTexture(&pinnedUniqueID)) { + + if (sk_sp proxy = as_IB(image)->refPinnedTextureProxy(&pinnedUniqueID)) { CHECK_SHOULD_DRAW(); - GrTextureAdjuster adjuster(this->context(), tex.get(), image->alphaType(), - image->bounds(), pinnedUniqueID, - as_IB(image)->onImageInfo().colorSpace()); + GrTextureAdjuster adjuster(this->context(), std::move(proxy), + image->alphaType(), image->bounds(), + pinnedUniqueID, as_IB(image)->onImageInfo().colorSpace()); this->drawTextureProducer(&adjuster, nullptr, nullptr, SkCanvas::kFast_SrcRectConstraint, viewMatrix, this->clip(), paint); return; @@ -1403,10 +1404,10 @@ void SkGpuDevice::drawImageRect(const SkImage* image, const SkRect* src, SkCanvas::SrcRectConstraint constraint) { ASSERT_SINGLE_OWNER uint32_t pinnedUniqueID; - if (sk_sp tex = as_IB(image)->refPinnedTexture(&pinnedUniqueID)) { + if (sk_sp proxy = as_IB(image)->refPinnedTextureProxy(&pinnedUniqueID)) { CHECK_SHOULD_DRAW(); - GrTextureAdjuster adjuster(this->context(), tex.get(), image->alphaType(), - image->bounds(), pinnedUniqueID, + GrTextureAdjuster adjuster(this->context(), std::move(proxy), + image->alphaType(), image->bounds(), pinnedUniqueID, as_IB(image)->onImageInfo().colorSpace()); this->drawTextureProducer(&adjuster, src, &dst, constraint, this->ctm(), this->clip(), paint); @@ -1479,11 +1480,11 @@ void SkGpuDevice::drawImageNine(const SkImage* image, const SkIRect& center, const SkRect& dst, const SkPaint& paint) { ASSERT_SINGLE_OWNER uint32_t pinnedUniqueID; - if (sk_sp tex = as_IB(image)->refPinnedTexture(&pinnedUniqueID)) { + if (sk_sp proxy = as_IB(image)->refPinnedTextureProxy(&pinnedUniqueID)) { CHECK_SHOULD_DRAW(); - GrTextureAdjuster adjuster(this->context(), tex.get(), image->alphaType(), - image->bounds(), pinnedUniqueID, - as_IB(image)->onImageInfo().colorSpace()); + GrTextureAdjuster adjuster(this->context(), std::move(proxy), + image->alphaType(), image->bounds(), + pinnedUniqueID, as_IB(image)->onImageInfo().colorSpace()); this->drawProducerNine(&adjuster, center, dst, paint); } else { SkBitmap bm; @@ -1535,11 +1536,11 @@ void SkGpuDevice::drawImageLattice(const SkImage* image, const SkPaint& paint) { ASSERT_SINGLE_OWNER uint32_t pinnedUniqueID; - if (sk_sp tex = as_IB(image)->refPinnedTexture(&pinnedUniqueID)) { + if (sk_sp proxy = as_IB(image)->refPinnedTextureProxy(&pinnedUniqueID)) { CHECK_SHOULD_DRAW(); - GrTextureAdjuster adjuster(this->context(), tex.get(), image->alphaType(), - image->bounds(), pinnedUniqueID, - as_IB(image)->onImageInfo().colorSpace()); + GrTextureAdjuster adjuster(this->context(), std::move(proxy), + image->alphaType(), image->bounds(), + pinnedUniqueID, as_IB(image)->onImageInfo().colorSpace()); this->drawProducerLattice(&adjuster, lattice, dst, paint); } else { SkBitmap bm; -- cgit v1.2.3