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

Unified Diff: cc/output/software_renderer.cc

Issue 23619012: cc: Adopt new skia object when it's created to avoid memory leak. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 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/software_renderer.cc
diff --git a/cc/output/software_renderer.cc b/cc/output/software_renderer.cc
index 77c44eadc3d2e62c70ef9080d8bac02d47c4109a..04f8a8bda8d24215fb60334224ba6f54fdc7b0c8 100644
--- a/cc/output/software_renderer.cc
+++ b/cc/output/software_renderer.cc
@@ -316,9 +316,10 @@ void SoftwareRenderer::DrawPictureQuad(const DrawingFrame* frame,
// TODO(aelias): This isn't correct in all cases. We should detect these
// cases and fall back to a persistent bitmap backing
// (http://crbug.com/280374).
+ skia::RefPtr<SkDrawFilter> opacity_filter =
+ skia::AdoptRef(new skia::OpacityDrawFilter(quad->opacity(), true));
DCHECK(!current_canvas_->getDrawFilter());
- current_canvas_->setDrawFilter(new skia::OpacityDrawFilter(quad->opacity(),
- true));
+ current_canvas_->setDrawFilter(opacity_filter.get());
TRACE_EVENT0("cc",
"SoftwareRenderer::DrawPictureQuad");
« 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