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

Unified Diff: ui/compositor/layer_unittest.cc

Issue 637933004: Fix memory issues in compositor_unittests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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: ui/compositor/layer_unittest.cc
diff --git a/ui/compositor/layer_unittest.cc b/ui/compositor/layer_unittest.cc
index e83eb33e0f1c3585be0b2390bb790df49877dc74..bfe119404dd8a47701526ba5bd72e9e5a0ee0011 100644
--- a/ui/compositor/layer_unittest.cc
+++ b/ui/compositor/layer_unittest.cc
@@ -231,7 +231,7 @@ class TestLayerDelegate : public LayerDelegate {
virtual void OnPaintLayer(gfx::Canvas* canvas) OVERRIDE {
SkISize size = canvas->sk_canvas()->getBaseLayerSize();
paint_size_ = gfx::Size(size.width(), size.height());
- canvas->FillRect(gfx::Rect(paint_size_), colors_[color_index_]);
+ canvas->DrawColor(colors_[color_index_]);
color_index_ = (color_index_ + 1) % static_cast<int>(colors_.size());
const SkMatrix& matrix = canvas->sk_canvas()->getTotalMatrix();
scale_x_ = matrix.getScaleX();
@@ -283,6 +283,7 @@ class DrawTreeLayerDelegate : public LayerDelegate {
// Overridden from LayerDelegate:
virtual void OnPaintLayer(gfx::Canvas* canvas) OVERRIDE {
painted_ = true;
+ canvas->DrawColor(SK_ColorTRANSPARENT);
}
virtual void OnDelegatedFrameDamage(
const gfx::Rect& damage_rect_in_dip) OVERRIDE {}
« 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