Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(234)

Unified Diff: src/gpu/GrContext.cpp

Issue 2163323002: Add desired width & height to drawContext (as opposed to using the width & height of the RT) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: More Clean up Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/effects/SkGpuBlurUtils.cpp ('k') | src/gpu/GrDrawContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrContext.cpp
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index 4cb90c658e1b3346d9220812a202332d7970a6f2..75c9536c14cdc6bfcb0e08487ef93deb12651a49 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -357,7 +357,8 @@ bool GrContext::writeSurfacePixels(GrSurface* surface,
}
SkMatrix matrix;
matrix.setTranslate(SkIntToScalar(left), SkIntToScalar(top));
- sk_sp<GrDrawContext> drawContext(this->drawContext(sk_ref_sp(renderTarget)));
+ sk_sp<GrDrawContext> drawContext(this->drawContext(surface->width(), surface->height(),
+ sk_ref_sp(renderTarget)));
if (!drawContext) {
return false;
}
@@ -534,7 +535,8 @@ bool GrContext::applyGamma(GrRenderTarget* dst, GrTexture* src, SkScalar gamma){
SkSurfaceProps props(SkSurfaceProps::kGammaCorrect_Flag,
SkSurfaceProps::kLegacyFontHost_InitType);
- sk_sp<GrDrawContext> drawContext(this->drawContext(sk_ref_sp(dst), &props));
+ sk_sp<GrDrawContext> drawContext(this->drawContext(dst->width(), dst->height(),
+ sk_ref_sp(dst), &props));
if (!drawContext) {
return false;
}
@@ -596,7 +598,8 @@ bool GrContext::copySurface(GrSurface* dst, GrSurface* src, const SkIRect& srcRe
src->flushWrites();
return fGpu->copySurface(dst, src, clippedSrcRect, clippedDstPoint);
}
- sk_sp<GrDrawContext> drawContext(this->drawContext(sk_ref_sp(dst->asRenderTarget())));
+ sk_sp<GrDrawContext> drawContext(this->drawContext(dst->width(), dst->height(),
+ sk_ref_sp(dst->asRenderTarget())));
if (!drawContext) {
return false;
}
@@ -635,10 +638,10 @@ int GrContext::getRecommendedSampleCount(GrPixelConfig config,
}
-sk_sp<GrDrawContext> GrContext::drawContext(sk_sp<GrRenderTarget> rt,
+sk_sp<GrDrawContext> GrContext::drawContext(int width, int height, sk_sp<GrRenderTarget> rt,
const SkSurfaceProps* surfaceProps) {
ASSERT_SINGLE_OWNER
- return fDrawingManager->drawContext(std::move(rt), surfaceProps);
+ return fDrawingManager->drawContext(width, height, std::move(rt), surfaceProps);
}
sk_sp<GrDrawContext> GrContext::newDrawContext(SkBackingFit fit,
@@ -666,8 +669,9 @@ sk_sp<GrDrawContext> GrContext::newDrawContext(SkBackingFit fit,
return nullptr;
}
- sk_sp<GrDrawContext> drawContext(this->drawContext(sk_ref_sp(tex->asRenderTarget()),
- surfaceProps));
+ sk_sp<GrDrawContext> drawContext(fDrawingManager->drawContext(width, height,
+ sk_ref_sp(tex->asRenderTarget()),
+ surfaceProps));
if (!drawContext) {
return nullptr;
}
« no previous file with comments | « src/effects/SkGpuBlurUtils.cpp ('k') | src/gpu/GrDrawContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698