OLD | NEW |
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 <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 scoped_ptr<OutputSurface> output_surface) { | 164 scoped_ptr<OutputSurface> output_surface) { |
165 host_impl_ = LayerTreeHostImpl::Create(settings, | 165 host_impl_ = LayerTreeHostImpl::Create(settings, |
166 this, | 166 this, |
167 &proxy_, | 167 &proxy_, |
168 &stats_instrumentation_, | 168 &stats_instrumentation_, |
169 shared_bitmap_manager_.get(), | 169 shared_bitmap_manager_.get(), |
170 gpu_memory_buffer_manager_.get(), | 170 gpu_memory_buffer_manager_.get(), |
171 0); | 171 0); |
172 bool init = host_impl_->InitializeRenderer(output_surface.Pass()); | 172 bool init = host_impl_->InitializeRenderer(output_surface.Pass()); |
173 host_impl_->SetViewportSize(gfx::Size(10, 10)); | 173 host_impl_->SetViewportSize(gfx::Size(10, 10)); |
| 174 // Set the BeginFrameArgs so that methods which use it are able to. |
| 175 host_impl_->WillBeginImplFrame( |
| 176 CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE)); |
174 return init; | 177 return init; |
175 } | 178 } |
176 | 179 |
177 void SetupRootLayerImpl(scoped_ptr<LayerImpl> root) { | 180 void SetupRootLayerImpl(scoped_ptr<LayerImpl> root) { |
178 root->SetPosition(gfx::PointF()); | 181 root->SetPosition(gfx::PointF()); |
179 root->SetBounds(gfx::Size(10, 10)); | 182 root->SetBounds(gfx::Size(10, 10)); |
180 root->SetContentBounds(gfx::Size(10, 10)); | 183 root->SetContentBounds(gfx::Size(10, 10)); |
181 root->SetDrawsContent(true); | 184 root->SetDrawsContent(true); |
182 root->draw_properties().visible_content_rect = gfx::Rect(0, 0, 10, 10); | 185 root->draw_properties().visible_content_rect = gfx::Rect(0, 0, 10, 10); |
183 host_impl_->active_tree()->SetRootLayer(root.Pass()); | 186 host_impl_->active_tree()->SetRootLayer(root.Pass()); |
(...skipping 7827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8011 // surface. | 8014 // surface. |
8012 EXPECT_EQ(0, num_lost_surfaces_); | 8015 EXPECT_EQ(0, num_lost_surfaces_); |
8013 host_impl_->DidLoseOutputSurface(); | 8016 host_impl_->DidLoseOutputSurface(); |
8014 EXPECT_EQ(1, num_lost_surfaces_); | 8017 EXPECT_EQ(1, num_lost_surfaces_); |
8015 host_impl_->DidLoseOutputSurface(); | 8018 host_impl_->DidLoseOutputSurface(); |
8016 EXPECT_LE(1, num_lost_surfaces_); | 8019 EXPECT_LE(1, num_lost_surfaces_); |
8017 } | 8020 } |
8018 | 8021 |
8019 } // namespace | 8022 } // namespace |
8020 } // namespace cc | 8023 } // namespace cc |
OLD | NEW |