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

Unified Diff: src/gpu/SkGr.cpp

Issue 318923005: SkShader::asNewEffect Refactoring (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Style corrections Created 6 years, 6 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 31372cd02a1816cf378ecae4f71070465983955d..b1977810fd30a8f198e9ba894e4adef6d56a9b6e 100644
--- a/src/gpu/SkGr.cpp
+++ b/src/gpu/SkGr.cpp
@@ -492,7 +492,11 @@ void SkPaint2GrPaintShader(GrContext* context, const SkPaint& skPaint,
AutoMatrix am(context);
// setup the shader as the first color effect on the paint
- SkAutoTUnref<GrEffectRef> effect(shader->asNewEffect(context, skPaint, NULL));
+ GrColor grColor;
+ GrEffectRef* grEffect;
+ grEffect = NULL;
+ shader->asNewEffect(context, skPaint, &grColor, &grEffect, NULL);
jvanverth1 2014/06/05 17:03:07 The bool return value isn't checked here. Also, in
bsalomon 2014/06/05 17:32:44 I can't think of a better way other than sending d
jvanverth1 2014/06/05 17:36:31 If it does succeed, it should also use the returne
dandov 2014/06/06 21:50:44 When the call to asNewEffect returns true (if noth
+ SkAutoTUnref<GrEffectRef> effect(grEffect);
if (NULL != effect.get()) {
grPaint->addColorEffect(effect);
// Now setup the rest of the paint.

Powered by Google App Engine
This is Rietveld 408576698