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

Unified Diff: cc/output/gl_renderer.cc

Issue 19267024: cc: Don't leak a ref to SkColorFilter. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: filterleak: raw pointer Created 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/gl_renderer.cc
diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc
index 0133b277d66461809010534a6e56e07fc9c47a92..2b1f2a1bf8649739a8c7ed0af6d87ebe3c4904b8 100644
--- a/cc/output/gl_renderer.cc
+++ b/cc/output/gl_renderer.cc
@@ -752,9 +752,15 @@ void GLRenderer::DrawRenderPassQuad(DrawingFrame* frame,
SkScalar color_matrix[20];
bool use_color_matrix = false;
if (quad->filter) {
- SkColorFilter* cf;
- if ((quad->filter->asColorFilter(&cf)) && cf->asColorMatrix(color_matrix) &&
- !quad->filter->getInput(0)) {
+ skia::RefPtr<SkColorFilter> cf;
+
+ {
+ SkColorFilter* colorfilter_rawptr = NULL;
+ quad->filter->asColorFilter(&colorfilter_rawptr);
+ cf = skia::AdoptRef(colorfilter_rawptr);
+ }
+
+ if (cf && cf->asColorMatrix(color_matrix) && !quad->filter->getInput(0)) {
// We have a single color matrix as a filter; apply it locally
// in the compositor.
use_color_matrix = true;
« 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