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

Unified Diff: src/gpu/GrDrawContext.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/gpu/GrContext.cpp ('k') | src/gpu/GrDrawingManager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDrawContext.cpp
diff --git a/src/gpu/GrDrawContext.cpp b/src/gpu/GrDrawContext.cpp
index 8bbf55b8ec4d2987e62fa30012036681030a3771..8a49206702233849b0ec3f87d878cd75cd0d167e 100644
--- a/src/gpu/GrDrawContext.cpp
+++ b/src/gpu/GrDrawContext.cpp
@@ -67,11 +67,14 @@ bool GrDrawContext::wasAbandoned() const {
// when the drawContext attempts to use it (via getDrawTarget).
GrDrawContext::GrDrawContext(GrContext* context,
GrDrawingManager* drawingMgr,
+ int width, int height,
sk_sp<GrRenderTarget> rt,
const SkSurfaceProps* surfaceProps,
GrAuditTrail* auditTrail,
GrSingleOwner* singleOwner)
: fDrawingManager(drawingMgr)
+ , fWidth(width)
+ , fHeight(height)
, fRenderTarget(std::move(rt))
, fDrawTarget(SkSafeRef(fRenderTarget->getLastDrawTarget()))
, fContext(context)
@@ -197,7 +200,8 @@ void GrDrawContext::clear(const SkIRect* rect,
AutoCheckFlush acf(fDrawingManager);
- const SkIRect rtRect = SkIRect::MakeWH(this->width(), this->height());
+ const SkIRect rtRect = SkIRect::MakeWH(this->accessRenderTarget()->width(),
+ this->accessRenderTarget()->height());
SkIRect clippedRect;
if (!rect ||
(canIgnoreRect && fContext->caps()->fullClearIsFree()) ||
@@ -1116,8 +1120,7 @@ bool GrDrawContextPriv::drawAndStencilPath(const GrFixedClip& clip,
if (path.isEmpty() && path.isInverseFillType()) {
this->drawAndStencilRect(clip, ss, op, invert, false, SkMatrix::I(),
- SkRect::MakeIWH(fDrawContext->width(),
- fDrawContext->height()));
+ SkRect::MakeIWH(fDrawContext->width(), fDrawContext->height()));
return true;
}
« no previous file with comments | « src/gpu/GrContext.cpp ('k') | src/gpu/GrDrawingManager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698