aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2017-09-29 15:21:28 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-09-29 19:42:54 +0000
commit4faa0408c1fc414263a3116a76ede20cc52b1d97 (patch)
tree11f143025b1e51ba1475fa1c52cbd1ed56bd63cf
parent9729dcbcf180317bb2f1a5380c8aa6b699297a2a (diff)
Remove unused outOffset param in GrTextureAdjuster
Bug: skia: Change-Id: Ifb5ee9d2d80badf082cf1888d2289fea6344c0e9 Reviewed-on: https://skia-review.googlesource.com/53400 Commit-Queue: Greg Daniel <egdaniel@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
-rw-r--r--src/gpu/GrTextureAdjuster.cpp20
-rw-r--r--src/gpu/GrTextureAdjuster.h8
-rw-r--r--src/image/SkImage_Gpu.cpp2
-rw-r--r--src/image/SkImage_Raster.cpp2
4 files changed, 9 insertions, 23 deletions
diff --git a/src/gpu/GrTextureAdjuster.cpp b/src/gpu/GrTextureAdjuster.cpp
index a06c64f335..e42be3fc7f 100644
--- a/src/gpu/GrTextureAdjuster.cpp
+++ b/src/gpu/GrTextureAdjuster.cpp
@@ -24,8 +24,8 @@ GrTextureAdjuster::GrTextureAdjuster(GrContext* context, sk_sp<GrTextureProxy> o
, fColorSpace(cs)
, fUniqueID(uniqueID) {
SkASSERT(SkIRect::MakeWH(fOriginal->width(), fOriginal->height()).contains(contentArea));
- if (contentArea.fLeft > 0 || contentArea.fTop > 0 ||
- contentArea.fRight < fOriginal->width() || contentArea.fBottom < fOriginal->height()) {
+ SkASSERT(0 == contentArea.fLeft && 0 == contentArea.fTop);
+ if (contentArea.fRight < fOriginal->width() || contentArea.fBottom < fOriginal->height()) {
fContentArea.set(contentArea);
}
}
@@ -69,7 +69,6 @@ sk_sp<GrTextureProxy> GrTextureAdjuster::refTextureProxyCopy(const CopyParams& c
}
sk_sp<GrTextureProxy> GrTextureAdjuster::refTextureProxySafeForParams(const GrSamplerState& params,
- SkIPoint* outOffset,
SkScalar scaleAdjust[2]) {
sk_sp<GrTextureProxy> proxy = this->originalProxyRef();
CopyParams copyParams;
@@ -88,21 +87,10 @@ sk_sp<GrTextureProxy> GrTextureAdjuster::refTextureProxySafeForParams(const GrSa
copyParams.fFilter = GrSamplerState::Filter::kBilerp;
} else if (!fContext->getGpu()->isACopyNeededForTextureParams(proxy.get(), params, &copyParams,
scaleAdjust)) {
- if (outOffset) {
- if (contentArea) {
- outOffset->set(contentArea->fLeft, contentArea->fRight);
- } else {
- outOffset->set(0, 0);
- }
- }
return proxy;
}
- sk_sp<GrTextureProxy> copy = this->refTextureProxyCopy(copyParams);
- if (copy && outOffset) {
- outOffset->set(0, 0);
- }
- return copy;
+ return this->refTextureProxyCopy(copyParams);
}
std::unique_ptr<GrFragmentProcessor> GrTextureAdjuster::createFragmentProcessor(
@@ -131,7 +119,7 @@ std::unique_ptr<GrFragmentProcessor> GrTextureAdjuster::createFragmentProcessor(
}
SkScalar scaleAdjust[2] = { 1.0f, 1.0f };
sk_sp<GrTextureProxy> proxy(
- this->refTextureProxySafeForParams(samplerState, nullptr, scaleAdjust));
+ this->refTextureProxySafeForParams(samplerState, scaleAdjust));
if (!proxy) {
return nullptr;
}
diff --git a/src/gpu/GrTextureAdjuster.h b/src/gpu/GrTextureAdjuster.h
index cf84fe024e..5ee6edc79c 100644
--- a/src/gpu/GrTextureAdjuster.h
+++ b/src/gpu/GrTextureAdjuster.h
@@ -20,11 +20,9 @@
*/
class GrTextureAdjuster : public GrTextureProducer {
public:
- /** Makes the subset of the texture safe to use with the given texture parameters.
- outOffset will be the top-left corner of the subset if a copy is not made. Otherwise,
- the copy will be tight to the contents and outOffset will be (0, 0). If the copy's size
- does not match subset's dimensions then the contents are scaled to fit the copy.*/
- sk_sp<GrTextureProxy> refTextureProxySafeForParams(const GrSamplerState&, SkIPoint* outOffset,
+ /** Makes the subset of the texture safe to use with the given texture parameters. If the copy's
+ size does not match subset's dimensions then the contents are scaled to fit the copy.*/
+ sk_sp<GrTextureProxy> refTextureProxySafeForParams(const GrSamplerState&,
SkScalar scaleAdjust[2]);
std::unique_ptr<GrFragmentProcessor> createFragmentProcessor(
diff --git a/src/image/SkImage_Gpu.cpp b/src/image/SkImage_Gpu.cpp
index 356b800e83..0ff288cd88 100644
--- a/src/image/SkImage_Gpu.cpp
+++ b/src/image/SkImage_Gpu.cpp
@@ -125,7 +125,7 @@ sk_sp<GrTextureProxy> SkImage_Gpu::asTextureProxyRef(GrContext* context,
GrTextureAdjuster adjuster(fContext, fProxy, this->alphaType(), this->bounds(),
this->uniqueID(), this->fColorSpace.get());
- return adjuster.refTextureProxySafeForParams(params, nullptr, scaleAdjust);
+ return adjuster.refTextureProxySafeForParams(params, scaleAdjust);
}
static void apply_premul(const SkImageInfo& info, void* pixels, size_t rowBytes) {
diff --git a/src/image/SkImage_Raster.cpp b/src/image/SkImage_Raster.cpp
index bade1b6235..3150488282 100644
--- a/src/image/SkImage_Raster.cpp
+++ b/src/image/SkImage_Raster.cpp
@@ -189,7 +189,7 @@ sk_sp<GrTextureProxy> SkImage_Raster::asTextureProxyRef(GrContext* context,
GrTextureAdjuster adjuster(context, fPinnedProxy,
fBitmap.alphaType(), fBitmap.bounds(),
fPinnedUniqueID, fBitmap.colorSpace());
- return adjuster.refTextureProxySafeForParams(params, nullptr, scaleAdjust);
+ return adjuster.refTextureProxySafeForParams(params, scaleAdjust);
}
return GrRefCachedBitmapTextureProxy(context, fBitmap, params, scaleAdjust);