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

Side by Side Diff: ui/compositor/layer_unittest.cc

Issue 643223003: Fix more 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/bind.h" 6 #include "base/bind.h"
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 void Reset() { 276 void Reset() {
277 painted_ = false; 277 painted_ = false;
278 } 278 }
279 279
280 bool painted() const { return painted_; } 280 bool painted() const { return painted_; }
281 281
282 private: 282 private:
283 // Overridden from LayerDelegate: 283 // Overridden from LayerDelegate:
284 virtual void OnPaintLayer(gfx::Canvas* canvas) override { 284 virtual void OnPaintLayer(gfx::Canvas* canvas) override {
285 painted_ = true; 285 painted_ = true;
286 canvas->DrawColor(SK_ColorTRANSPARENT); 286 canvas->DrawColor(SK_ColorWHITE);
287 } 287 }
288 virtual void OnDelegatedFrameDamage( 288 virtual void OnDelegatedFrameDamage(
289 const gfx::Rect& damage_rect_in_dip) override {} 289 const gfx::Rect& damage_rect_in_dip) override {}
290 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) override { 290 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) override {
291 } 291 }
292 virtual base::Closure PrepareForLayerBoundsChange() override { 292 virtual base::Closure PrepareForLayerBoundsChange() override {
293 return base::Closure(); 293 return base::Closure();
294 } 294 }
295 295
296 bool painted_; 296 bool painted_;
(...skipping 1448 matching lines...) Expand 10 before | Expand all | Expand 10 after
1745 MakeFrameData(gfx::Size(10, 10)))); 1745 MakeFrameData(gfx::Size(10, 10))));
1746 layer->SetShowDelegatedContent(frame_provider.get(), gfx::Size(10, 10)); 1746 layer->SetShowDelegatedContent(frame_provider.get(), gfx::Size(10, 10));
1747 1747
1748 EXPECT_FALSE(delegate.delegated_frame_damage_called()); 1748 EXPECT_FALSE(delegate.delegated_frame_damage_called());
1749 layer->OnDelegatedFrameDamage(damage_rect); 1749 layer->OnDelegatedFrameDamage(damage_rect);
1750 EXPECT_TRUE(delegate.delegated_frame_damage_called()); 1750 EXPECT_TRUE(delegate.delegated_frame_damage_called());
1751 EXPECT_EQ(damage_rect, delegate.delegated_frame_damage_rect()); 1751 EXPECT_EQ(damage_rect, delegate.delegated_frame_damage_rect());
1752 } 1752 }
1753 1753
1754 } // namespace ui 1754 } // namespace ui
OLDNEW
« 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