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

Unified Diff: gm/rrects.cpp

Issue 1582933002: micro fix for rrects bug using GrDrawContext (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/rrects.cpp
diff --git a/gm/rrects.cpp b/gm/rrects.cpp
index 8cb737b21cd83eafc3add526c5d179118ecd6274..63d6c9e6dbbf2adb56e8528d291ed53bee96c0b0 100644
--- a/gm/rrects.cpp
+++ b/gm/rrects.cpp
@@ -67,9 +67,17 @@ protected:
#if SK_SUPPORT_GPU
GrRenderTarget* rt = canvas->internal_private_accessTopLayerRenderTarget();
context = rt ? rt->getContext() : nullptr;
- SkAutoTUnref<GrDrawContext> drawContext(context->drawContext(rt));
- if (!drawContext) {
- return;
+ SkAutoTUnref<GrDrawContext> drawContext;
+ if (kEffect_Type == fType) {
+ if (!context) {
+ skiagm::GM::DrawGpuOnlyMessage(canvas);
+ return;
+ }
+
+ drawContext.reset(context->drawContext(rt));
+ if (!drawContext) {
+ return;
+ }
}
#endif
if (kEffect_Type == fType && nullptr == context) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698