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

Side by Side Diff: src/effects/SkBlurMaskFilter.cpp

Issue 1321353002: Limit lifetime of GrDrawContext objects (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update to ToT Created 5 years, 3 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 unified diff | Download patch
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "SkBlurMaskFilter.h" 9 #include "SkBlurMaskFilter.h"
10 #include "SkBlurMask.h" 10 #include "SkBlurMask.h"
(...skipping 1208 matching lines...) Expand 10 before | Expand all | Expand 10 after
1219 } else if (kSolid_SkBlurStyle == fBlurStyle) { 1219 } else if (kSolid_SkBlurStyle == fBlurStyle) {
1220 // solid: dst = src + dst - src * dst 1220 // solid: dst = src + dst - src * dst
1221 // = src + (1 - src) * dst 1221 // = src + (1 - src) * dst
1222 paint.setCoverageSetOpXPFactory(SkRegion::kUnion_Op); 1222 paint.setCoverageSetOpXPFactory(SkRegion::kUnion_Op);
1223 } else if (kOuter_SkBlurStyle == fBlurStyle) { 1223 } else if (kOuter_SkBlurStyle == fBlurStyle) {
1224 // outer: dst = dst * (1 - src) 1224 // outer: dst = dst * (1 - src)
1225 // = 0 * src + (1 - src) * dst 1225 // = 0 * src + (1 - src) * dst
1226 paint.setCoverageSetOpXPFactory(SkRegion::kDifference_Op); 1226 paint.setCoverageSetOpXPFactory(SkRegion::kDifference_Op);
1227 } 1227 }
1228 1228
1229 GrDrawContext* drawContext = context->drawContext(); 1229 SkAutoTUnref<GrDrawContext> drawContext(context->drawContext());
1230 if (!drawContext) { 1230 if (!drawContext) {
1231 return false; 1231 return false;
1232 } 1232 }
1233 1233
1234 drawContext->drawRect((*result)->asRenderTarget(), GrClip::WideOpen(), 1234 drawContext->drawRect((*result)->asRenderTarget(), GrClip::WideOpen(),
1235 paint, SkMatrix::I(), clipRect); 1235 paint, SkMatrix::I(), clipRect);
1236 } 1236 }
1237 1237
1238 return true; 1238 return true;
1239 } 1239 }
(...skipping 26 matching lines...) Expand all
1266 } else { 1266 } else {
1267 str->append("None"); 1267 str->append("None");
1268 } 1268 }
1269 str->append("))"); 1269 str->append("))");
1270 } 1270 }
1271 #endif 1271 #endif
1272 1272
1273 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) 1273 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter)
1274 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) 1274 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl)
1275 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END 1275 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698