aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrTextureProducer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/GrTextureProducer.cpp')
-rw-r--r--src/gpu/GrTextureProducer.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/gpu/GrTextureProducer.cpp b/src/gpu/GrTextureProducer.cpp
index 496dbb2d0b..0adae8c750 100644
--- a/src/gpu/GrTextureProducer.cpp
+++ b/src/gpu/GrTextureProducer.cpp
@@ -52,9 +52,16 @@ GrTexture* GrTextureProducer::CopyOnGpu(GrTexture* inputTexture, const SkIRect*
SkRect localRect;
if (subset) {
+ SkScalar sx = SK_Scalar1 / inputTexture->width();
+ SkScalar sy = SK_Scalar1 / inputTexture->height();
+
localRect = SkRect::Make(*subset);
+ localRect.fLeft *= sx;
+ localRect.fTop *= sy;
+ localRect.fRight *= sx;
+ localRect.fBottom *= sy;
} else {
- localRect = SkRect::MakeWH(inputTexture->width(), inputTexture->height());
+ localRect = SkRect::MakeWH(1.f, 1.f);
}
SkRect dstRect = SkRect::MakeIWH(copyParams.fWidth, copyParams.fHeight);