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

Unified Diff: src/gpu/SkGr.cpp

Issue 1151283004: Split drawing functionality out of GrContext and into new GrDrawContext (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 7 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
Index: src/gpu/SkGr.cpp
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp
index 2fc0996d84cf2d42bb6c913c3ebe622807eaac75..ab6fedebffb930812e70806be51cdc54e9d0e7b3 100644
--- a/src/gpu/SkGr.cpp
+++ b/src/gpu/SkGr.cpp
@@ -7,6 +7,7 @@
#include "SkGr.h"
+#include "GrDrawContext.h"
#include "GrXferProcessor.h"
#include "SkColorFilter.h"
#include "SkConfig8888.h"
@@ -245,8 +246,13 @@ GrTexture* stretch_texture_to_next_pot(GrTexture* inputTexture, Stretch stretch,
SkRect rect = SkRect::MakeWH(SkIntToScalar(rtDesc.fWidth), SkIntToScalar(rtDesc.fHeight));
SkRect localRect = SkRect::MakeWH(1.f, 1.f);
- context->drawNonAARectToRect(stretched->asRenderTarget(), GrClip::WideOpen(), paint,
- SkMatrix::I(), rect, localRect);
+ GrDrawContext* drawContext = context->drawContext();
+ if (!drawContext) {
+ return NULL;
+ }
+
+ drawContext->drawNonAARectToRect(stretched->asRenderTarget(), GrClip::WideOpen(), paint,
+ SkMatrix::I(), rect, localRect);
return stretched;
}
@@ -398,7 +404,12 @@ static GrTexture* load_yuv_texture(GrContext* ctx, const GrUniqueKey& optionalKe
SkRect r = SkRect::MakeWH(SkIntToScalar(yuvInfo.fSize[0].fWidth),
SkIntToScalar(yuvInfo.fSize[0].fHeight));
- ctx->drawRect(renderTarget, GrClip::WideOpen(), paint, SkMatrix::I(), r);
+ GrDrawContext* drawContext = ctx->drawContext();
+ if (!drawContext) {
+ return NULL;
+ }
+
+ drawContext->drawRect(renderTarget, GrClip::WideOpen(), paint, SkMatrix::I(), r);
return result;
}

Powered by Google App Engine
This is Rietveld 408576698