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

Side by Side Diff: cc/trees/layer_tree_host_impl_unittest.cc

Issue 16871016: cc: Use BeginFrameArgs (Closed) Base URL: http://git.chromium.org/chromium/src.git@bfargs2
Patch Set: Another round of cleanup Created 7 years, 4 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 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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 "cc/trees/layer_tree_host_impl.h" 5 #include "cc/trees/layer_tree_host_impl.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 60
61 class LayerTreeHostImplTest : public testing::Test, 61 class LayerTreeHostImplTest : public testing::Test,
62 public LayerTreeHostImplClient { 62 public LayerTreeHostImplClient {
63 public: 63 public:
64 LayerTreeHostImplTest() 64 LayerTreeHostImplTest()
65 : proxy_(), 65 : proxy_(),
66 always_impl_thread_(&proxy_), 66 always_impl_thread_(&proxy_),
67 always_main_thread_blocked_(&proxy_), 67 always_main_thread_blocked_(&proxy_),
68 did_try_initialize_renderer_(false), 68 did_try_initialize_renderer_(false),
69 on_can_draw_state_changed_called_(false), 69 on_can_draw_state_changed_called_(false),
70 did_notify_ready_to_activate_(false),
70 has_pending_tree_(false), 71 has_pending_tree_(false),
71 did_request_commit_(false), 72 did_request_commit_(false),
72 did_request_redraw_(false), 73 did_request_redraw_(false),
73 did_upload_visible_tile_(false), 74 did_upload_visible_tile_(false),
74 reduce_memory_result_(true), 75 reduce_memory_result_(true),
75 current_limit_bytes_(0), 76 current_limit_bytes_(0),
76 current_priority_cutoff_value_(0) { 77 current_priority_cutoff_value_(0) {
77 media::InitializeMediaLibraryForTesting(); 78 media::InitializeMediaLibraryForTesting();
78 } 79 }
79 80
(...skipping 18 matching lines...) Expand all
98 scoped_refptr<ContextProvider> offscreen_context_provider) OVERRIDE { 99 scoped_refptr<ContextProvider> offscreen_context_provider) OVERRIDE {
99 did_try_initialize_renderer_ = true; 100 did_try_initialize_renderer_ = true;
100 } 101 }
101 virtual void DidLoseOutputSurfaceOnImplThread() OVERRIDE {} 102 virtual void DidLoseOutputSurfaceOnImplThread() OVERRIDE {}
102 virtual void OnSwapBuffersCompleteOnImplThread() OVERRIDE {} 103 virtual void OnSwapBuffersCompleteOnImplThread() OVERRIDE {}
103 virtual void BeginFrameOnImplThread(const BeginFrameArgs& args) 104 virtual void BeginFrameOnImplThread(const BeginFrameArgs& args)
104 OVERRIDE {} 105 OVERRIDE {}
105 virtual void OnCanDrawStateChanged(bool can_draw) OVERRIDE { 106 virtual void OnCanDrawStateChanged(bool can_draw) OVERRIDE {
106 on_can_draw_state_changed_called_ = true; 107 on_can_draw_state_changed_called_ = true;
107 } 108 }
109 virtual void NotifyReadyToActivate() OVERRIDE {
110 did_notify_ready_to_activate_ = true;
111 host_impl_->ActivatePendingTree();
112 }
108 virtual void OnHasPendingTreeStateChanged(bool has_pending_tree) OVERRIDE { 113 virtual void OnHasPendingTreeStateChanged(bool has_pending_tree) OVERRIDE {
109 has_pending_tree_ = has_pending_tree; 114 has_pending_tree_ = has_pending_tree;
110 } 115 }
111 virtual void SetNeedsRedrawOnImplThread() OVERRIDE { 116 virtual void SetNeedsRedrawOnImplThread() OVERRIDE {
112 did_request_redraw_ = true; 117 did_request_redraw_ = true;
113 } 118 }
114 virtual void SetNeedsRedrawRectOnImplThread(gfx::Rect damage_rect) OVERRIDE { 119 virtual void SetNeedsRedrawRectOnImplThread(gfx::Rect damage_rect) OVERRIDE {
115 did_request_redraw_ = true; 120 did_request_redraw_ = true;
116 } 121 }
117 virtual void DidInitializeVisibleTileOnImplThread() OVERRIDE { 122 virtual void DidInitializeVisibleTileOnImplThread() OVERRIDE {
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 } 350 }
346 351
347 FakeProxy proxy_; 352 FakeProxy proxy_;
348 DebugScopedSetImplThread always_impl_thread_; 353 DebugScopedSetImplThread always_impl_thread_;
349 DebugScopedSetMainThreadBlocked always_main_thread_blocked_; 354 DebugScopedSetMainThreadBlocked always_main_thread_blocked_;
350 355
351 scoped_ptr<LayerTreeHostImpl> host_impl_; 356 scoped_ptr<LayerTreeHostImpl> host_impl_;
352 FakeRenderingStatsInstrumentation stats_instrumentation_; 357 FakeRenderingStatsInstrumentation stats_instrumentation_;
353 bool did_try_initialize_renderer_; 358 bool did_try_initialize_renderer_;
354 bool on_can_draw_state_changed_called_; 359 bool on_can_draw_state_changed_called_;
360 bool did_notify_ready_to_activate_;
355 bool has_pending_tree_; 361 bool has_pending_tree_;
356 bool did_request_commit_; 362 bool did_request_commit_;
357 bool did_request_redraw_; 363 bool did_request_redraw_;
358 bool did_upload_visible_tile_; 364 bool did_upload_visible_tile_;
359 bool reduce_memory_result_; 365 bool reduce_memory_result_;
360 base::TimeDelta requested_scrollbar_animation_delay_; 366 base::TimeDelta requested_scrollbar_animation_delay_;
361 size_t current_limit_bytes_; 367 size_t current_limit_bytes_;
362 int current_priority_cutoff_value_; 368 int current_priority_cutoff_value_;
363 }; 369 };
364 370
(...skipping 5911 matching lines...) Expand 10 before | Expand all | Expand 10 after
6276 EXPECT_EQ(0u, host_impl_->ResourceIdForUIResource(ui_resource_id)); 6282 EXPECT_EQ(0u, host_impl_->ResourceIdForUIResource(ui_resource_id));
6277 EXPECT_EQ(0u, context3d->NumTextures()); 6283 EXPECT_EQ(0u, context3d->NumTextures());
6278 6284
6279 // Should not change state for multiple deletion on one UIResourceId 6285 // Should not change state for multiple deletion on one UIResourceId
6280 host_impl_->DeleteUIResource(ui_resource_id); 6286 host_impl_->DeleteUIResource(ui_resource_id);
6281 EXPECT_EQ(0u, context3d->NumTextures()); 6287 EXPECT_EQ(0u, context3d->NumTextures());
6282 } 6288 }
6283 6289
6284 } // namespace 6290 } // namespace
6285 } // namespace cc 6291 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698