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)
|
, fColorSpace(cs)
|
||||||
, fUniqueID(uniqueID) {
|
, fUniqueID(uniqueID) {
|
||||||
SkASSERT(SkIRect::MakeWH(fOriginal->width(), fOriginal->height()).contains(contentArea));
|
SkASSERT(SkIRect::MakeWH(fOriginal->width(), fOriginal->height()).contains(contentArea));
|
||||||
if (contentArea.fLeft > 0 || contentArea.fTop > 0 ||
|
SkASSERT(0 == contentArea.fLeft && 0 == contentArea.fTop);
|
||||||
contentArea.fRight < fOriginal->width() || contentArea.fBottom < fOriginal->height()) {
|
if (contentArea.fRight < fOriginal->width() || contentArea.fBottom < fOriginal->height()) {
|
||||||
fContentArea.set(contentArea);
|
fContentArea.set(contentArea);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -69,7 +69,6 @@ sk_sp<GrTextureProxy> GrTextureAdjuster::refTextureProxyCopy(const CopyParams& c
|
|||||||
}
|
}
|
||||||
|
|
||||||
sk_sp<GrTextureProxy> GrTextureAdjuster::refTextureProxySafeForParams(const GrSamplerState& params,
|
sk_sp<GrTextureProxy> GrTextureAdjuster::refTextureProxySafeForParams(const GrSamplerState& params,
|
||||||
SkIPoint* outOffset,
|
|
||||||
SkScalar scaleAdjust[2]) {
|
SkScalar scaleAdjust[2]) {
|
||||||
sk_sp<GrTextureProxy> proxy = this->originalProxyRef();
|
sk_sp<GrTextureProxy> proxy = this->originalProxyRef();
|
||||||
CopyParams copyParams;
|
CopyParams copyParams;
|
||||||
@ -88,21 +87,10 @@ sk_sp<GrTextureProxy> GrTextureAdjuster::refTextureProxySafeForParams(const GrSa
|
|||||||
copyParams.fFilter = GrSamplerState::Filter::kBilerp;
|
copyParams.fFilter = GrSamplerState::Filter::kBilerp;
|
||||||
} else if (!fContext->getGpu()->isACopyNeededForTextureParams(proxy.get(), params, ©Params,
|
} else if (!fContext->getGpu()->isACopyNeededForTextureParams(proxy.get(), params, ©Params,
|
||||||
scaleAdjust)) {
|
scaleAdjust)) {
|
||||||
if (outOffset) {
|
|
||||||
if (contentArea) {
|
|
||||||
outOffset->set(contentArea->fLeft, contentArea->fRight);
|
|
||||||
} else {
|
|
||||||
outOffset->set(0, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return proxy;
|
return proxy;
|
||||||
}
|
}
|
||||||
|
|
||||||
sk_sp<GrTextureProxy> copy = this->refTextureProxyCopy(copyParams);
|
return this->refTextureProxyCopy(copyParams);
|
||||||
if (copy && outOffset) {
|
|
||||||
outOffset->set(0, 0);
|
|
||||||
}
|
|
||||||
return copy;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<GrFragmentProcessor> GrTextureAdjuster::createFragmentProcessor(
|
std::unique_ptr<GrFragmentProcessor> GrTextureAdjuster::createFragmentProcessor(
|
||||||
@ -131,7 +119,7 @@ std::unique_ptr<GrFragmentProcessor> GrTextureAdjuster::createFragmentProcessor(
|
|||||||
}
|
}
|
||||||
SkScalar scaleAdjust[2] = { 1.0f, 1.0f };
|
SkScalar scaleAdjust[2] = { 1.0f, 1.0f };
|
||||||
sk_sp<GrTextureProxy> proxy(
|
sk_sp<GrTextureProxy> proxy(
|
||||||
this->refTextureProxySafeForParams(samplerState, nullptr, scaleAdjust));
|
this->refTextureProxySafeForParams(samplerState, scaleAdjust));
|
||||||
if (!proxy) {
|
if (!proxy) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
@ -20,11 +20,9 @@
|
|||||||
*/
|
*/
|
||||||
class GrTextureAdjuster : public GrTextureProducer {
|
class GrTextureAdjuster : public GrTextureProducer {
|
||||||
public:
|
public:
|
||||||
/** Makes the subset of the texture safe to use with the given texture parameters.
|
/** Makes the subset of the texture safe to use with the given texture parameters. If the copy's
|
||||||
outOffset will be the top-left corner of the subset if a copy is not made. Otherwise,
|
size does not match subset's dimensions then the contents are scaled to fit the copy.*/
|
||||||
the copy will be tight to the contents and outOffset will be (0, 0). If the copy's size
|
sk_sp<GrTextureProxy> refTextureProxySafeForParams(const GrSamplerState&,
|
||||||
does not match subset's dimensions then the contents are scaled to fit the copy.*/
|
|
||||||
sk_sp<GrTextureProxy> refTextureProxySafeForParams(const GrSamplerState&, SkIPoint* outOffset,
|
|
||||||
SkScalar scaleAdjust[2]);
|
SkScalar scaleAdjust[2]);
|
||||||
|
|
||||||
std::unique_ptr<GrFragmentProcessor> createFragmentProcessor(
|
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(),
|
GrTextureAdjuster adjuster(fContext, fProxy, this->alphaType(), this->bounds(),
|
||||||
this->uniqueID(), this->fColorSpace.get());
|
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) {
|
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,
|
GrTextureAdjuster adjuster(context, fPinnedProxy,
|
||||||
fBitmap.alphaType(), fBitmap.bounds(),
|
fBitmap.alphaType(), fBitmap.bounds(),
|
||||||
fPinnedUniqueID, fBitmap.colorSpace());
|
fPinnedUniqueID, fBitmap.colorSpace());
|
||||||
return adjuster.refTextureProxySafeForParams(params, nullptr, scaleAdjust);
|
return adjuster.refTextureProxySafeForParams(params, scaleAdjust);
|
||||||
}
|
}
|
||||||
|
|
||||||
return GrRefCachedBitmapTextureProxy(context, fBitmap, params, scaleAdjust);
|
return GrRefCachedBitmapTextureProxy(context, fBitmap, params, scaleAdjust);
|
||||||
|
Loading…
Reference in New Issue
Block a user