| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <cmath> | 10 #include <cmath> |
| 11 #include <utility> | 11 #include <utility> |
| 12 | 12 |
| 13 #include "base/bind.h" | 13 #include "base/bind.h" |
| 14 #include "base/command_line.h" | 14 #include "base/command_line.h" |
| 15 #include "base/location.h" | 15 #include "base/location.h" |
| 16 #include "base/thread_task_runner_handle.h" | 16 #include "base/thread_task_runner_handle.h" |
| 17 #include "cc/animation/animation_events.h" | 17 #include "cc/animation/animation_events.h" |
| 18 #include "cc/animation/animation_host.h" | 18 #include "cc/animation/animation_host.h" |
| 19 #include "cc/animation/animation_id_provider.h" | 19 #include "cc/animation/animation_id_provider.h" |
| 20 #include "cc/animation/transform_operations.h" | 20 #include "cc/animation/transform_operations.h" |
| 21 #include "cc/base/math_util.h" | 21 #include "cc/base/math_util.h" |
| 22 #include "cc/input/main_thread_scrolling_reason.h" | 22 #include "cc/input/main_thread_scrolling_reason.h" |
| 23 #include "cc/input/page_scale_animation.h" | 23 #include "cc/input/page_scale_animation.h" |
| 24 #include "cc/input/scrollbar_animation_controller_thinning.h" | 24 #include "cc/input/scrollbar_animation_controller_thinning.h" |
| 25 #include "cc/input/top_controls_manager.h" | 25 #include "cc/input/top_controls_manager.h" |
| 26 #include "cc/layers/append_quads_data.h" | 26 #include "cc/layers/append_quads_data.h" |
| 27 #include "cc/layers/heads_up_display_layer_impl.h" | 27 #include "cc/layers/heads_up_display_layer_impl.h" |
| 28 #include "cc/layers/io_surface_layer_impl.h" | |
| 29 #include "cc/layers/layer_impl.h" | 28 #include "cc/layers/layer_impl.h" |
| 30 #include "cc/layers/painted_scrollbar_layer_impl.h" | 29 #include "cc/layers/painted_scrollbar_layer_impl.h" |
| 31 #include "cc/layers/render_surface_impl.h" | 30 #include "cc/layers/render_surface_impl.h" |
| 32 #include "cc/layers/solid_color_layer_impl.h" | 31 #include "cc/layers/solid_color_layer_impl.h" |
| 33 #include "cc/layers/solid_color_scrollbar_layer_impl.h" | 32 #include "cc/layers/solid_color_scrollbar_layer_impl.h" |
| 34 #include "cc/layers/texture_layer_impl.h" | 33 #include "cc/layers/texture_layer_impl.h" |
| 35 #include "cc/layers/video_layer_impl.h" | 34 #include "cc/layers/video_layer_impl.h" |
| 36 #include "cc/layers/viewport.h" | 35 #include "cc/layers/viewport.h" |
| 37 #include "cc/output/begin_frame_args.h" | 36 #include "cc/output/begin_frame_args.h" |
| 38 #include "cc/output/compositor_frame_ack.h" | 37 #include "cc/output/compositor_frame_ack.h" |
| (...skipping 7143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7182 media::VideoFrame::CreateColorFrame( | 7181 media::VideoFrame::CreateColorFrame( |
| 7183 gfx::Size(4, 4), 0x80, 0x80, 0x80, base::TimeDelta()); | 7182 gfx::Size(4, 4), 0x80, 0x80, 0x80, base::TimeDelta()); |
| 7184 FakeVideoFrameProvider provider; | 7183 FakeVideoFrameProvider provider; |
| 7185 provider.set_frame(softwareFrame); | 7184 provider.set_frame(softwareFrame); |
| 7186 scoped_ptr<VideoLayerImpl> video_layer = VideoLayerImpl::Create( | 7185 scoped_ptr<VideoLayerImpl> video_layer = VideoLayerImpl::Create( |
| 7187 host_impl_->active_tree(), 4, &provider, media::VIDEO_ROTATION_0); | 7186 host_impl_->active_tree(), 4, &provider, media::VIDEO_ROTATION_0); |
| 7188 video_layer->SetBounds(gfx::Size(10, 10)); | 7187 video_layer->SetBounds(gfx::Size(10, 10)); |
| 7189 video_layer->SetDrawsContent(true); | 7188 video_layer->SetDrawsContent(true); |
| 7190 root_layer->AddChild(std::move(video_layer)); | 7189 root_layer->AddChild(std::move(video_layer)); |
| 7191 | 7190 |
| 7192 scoped_ptr<IOSurfaceLayerImpl> io_surface_layer = | |
| 7193 IOSurfaceLayerImpl::Create(host_impl_->active_tree(), 5); | |
| 7194 io_surface_layer->SetBounds(gfx::Size(10, 10)); | |
| 7195 io_surface_layer->SetDrawsContent(true); | |
| 7196 io_surface_layer->SetIOSurfaceProperties(1, gfx::Size(10, 10)); | |
| 7197 root_layer->AddChild(std::move(io_surface_layer)); | |
| 7198 | |
| 7199 host_impl_->active_tree()->SetRootLayer(std::move(root_layer)); | 7191 host_impl_->active_tree()->SetRootLayer(std::move(root_layer)); |
| 7200 | 7192 |
| 7201 EXPECT_EQ(0u, context3d->NumTextures()); | 7193 EXPECT_EQ(0u, context3d->NumTextures()); |
| 7202 | 7194 |
| 7203 LayerTreeHostImpl::FrameData frame; | 7195 LayerTreeHostImpl::FrameData frame; |
| 7204 EXPECT_EQ(DRAW_SUCCESS, PrepareToDrawFrame(&frame)); | 7196 EXPECT_EQ(DRAW_SUCCESS, PrepareToDrawFrame(&frame)); |
| 7205 host_impl_->DrawLayers(&frame); | 7197 host_impl_->DrawLayers(&frame); |
| 7206 host_impl_->DidDrawAllLayers(frame); | 7198 host_impl_->DidDrawAllLayers(frame); |
| 7207 host_impl_->SwapBuffers(frame); | 7199 host_impl_->SwapBuffers(frame); |
| 7208 | 7200 |
| (...skipping 3399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10608 // There should not be any jitter measured till we hit the fixed point hits | 10600 // There should not be any jitter measured till we hit the fixed point hits |
| 10609 // threshold. | 10601 // threshold. |
| 10610 float expected_jitter = | 10602 float expected_jitter = |
| 10611 (i == pending_tree->kFixedPointHitsThreshold) ? 500 : 0; | 10603 (i == pending_tree->kFixedPointHitsThreshold) ? 500 : 0; |
| 10612 EXPECT_EQ(jitter, expected_jitter); | 10604 EXPECT_EQ(jitter, expected_jitter); |
| 10613 } | 10605 } |
| 10614 } | 10606 } |
| 10615 | 10607 |
| 10616 } // namespace | 10608 } // namespace |
| 10617 } // namespace cc | 10609 } // namespace cc |
| OLD | NEW |