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>
This commit is contained in:
parent
9729dcbcf1
commit
4faa0408c1
@ -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, ©Params,
|
||||
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;
|
||||
}
|
||||
|
@ -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(
|
||||
|
@ -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) {
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user