| 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> |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 #include "cc/layers/heads_up_display_layer_impl.h" | 28 #include "cc/layers/heads_up_display_layer_impl.h" |
| 29 #include "cc/layers/layer_impl.h" | 29 #include "cc/layers/layer_impl.h" |
| 30 #include "cc/layers/painted_scrollbar_layer_impl.h" | 30 #include "cc/layers/painted_scrollbar_layer_impl.h" |
| 31 #include "cc/layers/render_surface_impl.h" | 31 #include "cc/layers/render_surface_impl.h" |
| 32 #include "cc/layers/solid_color_layer_impl.h" | 32 #include "cc/layers/solid_color_layer_impl.h" |
| 33 #include "cc/layers/solid_color_scrollbar_layer_impl.h" | 33 #include "cc/layers/solid_color_scrollbar_layer_impl.h" |
| 34 #include "cc/layers/texture_layer_impl.h" | 34 #include "cc/layers/texture_layer_impl.h" |
| 35 #include "cc/layers/video_layer_impl.h" | 35 #include "cc/layers/video_layer_impl.h" |
| 36 #include "cc/layers/viewport.h" | 36 #include "cc/layers/viewport.h" |
| 37 #include "cc/output/begin_frame_args.h" | 37 #include "cc/output/begin_frame_args.h" |
| 38 #include "cc/output/compositor_frame_ack.h" | |
| 39 #include "cc/output/compositor_frame_metadata.h" | 38 #include "cc/output/compositor_frame_metadata.h" |
| 40 #include "cc/output/copy_output_request.h" | 39 #include "cc/output/copy_output_request.h" |
| 41 #include "cc/output/copy_output_result.h" | 40 #include "cc/output/copy_output_result.h" |
| 42 #include "cc/output/gl_renderer.h" | 41 #include "cc/output/gl_renderer.h" |
| 43 #include "cc/output/latency_info_swap_promise.h" | 42 #include "cc/output/latency_info_swap_promise.h" |
| 44 #include "cc/quads/render_pass_draw_quad.h" | 43 #include "cc/quads/render_pass_draw_quad.h" |
| 45 #include "cc/quads/solid_color_draw_quad.h" | 44 #include "cc/quads/solid_color_draw_quad.h" |
| 46 #include "cc/quads/texture_draw_quad.h" | 45 #include "cc/quads/texture_draw_quad.h" |
| 47 #include "cc/quads/tile_draw_quad.h" | 46 #include "cc/quads/tile_draw_quad.h" |
| 48 #include "cc/test/animation_test_common.h" | 47 #include "cc/test/animation_test_common.h" |
| (...skipping 7726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7775 | 7774 |
| 7776 TEST_F(CompositorFrameMetadataTest, CompositorFrameAckCountsAsSwapComplete) { | 7775 TEST_F(CompositorFrameMetadataTest, CompositorFrameAckCountsAsSwapComplete) { |
| 7777 SetupRootLayerImpl(FakeLayerWithQuads::Create(host_impl_->active_tree(), 1)); | 7776 SetupRootLayerImpl(FakeLayerWithQuads::Create(host_impl_->active_tree(), 1)); |
| 7778 host_impl_->active_tree()->BuildPropertyTreesForTesting(); | 7777 host_impl_->active_tree()->BuildPropertyTreesForTesting(); |
| 7779 { | 7778 { |
| 7780 LayerTreeHostImpl::FrameData frame; | 7779 LayerTreeHostImpl::FrameData frame; |
| 7781 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame)); | 7780 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame)); |
| 7782 host_impl_->DrawLayers(&frame); | 7781 host_impl_->DrawLayers(&frame); |
| 7783 host_impl_->DidDrawAllLayers(frame); | 7782 host_impl_->DidDrawAllLayers(frame); |
| 7784 } | 7783 } |
| 7785 CompositorFrameAck ack; | 7784 host_impl_->ReclaimResources(ReturnedResourceArray()); |
| 7786 host_impl_->ReclaimResources(&ack); | |
| 7787 host_impl_->DidSwapBuffersComplete(); | 7785 host_impl_->DidSwapBuffersComplete(); |
| 7788 EXPECT_EQ(swap_buffers_complete_, 1); | 7786 EXPECT_EQ(swap_buffers_complete_, 1); |
| 7789 } | 7787 } |
| 7790 | 7788 |
| 7791 class CountingSoftwareDevice : public SoftwareOutputDevice { | 7789 class CountingSoftwareDevice : public SoftwareOutputDevice { |
| 7792 public: | 7790 public: |
| 7793 CountingSoftwareDevice() : frames_began_(0), frames_ended_(0) {} | 7791 CountingSoftwareDevice() : frames_began_(0), frames_ended_(0) {} |
| 7794 | 7792 |
| 7795 SkCanvas* BeginPaint(const gfx::Rect& damage_rect) override { | 7793 SkCanvas* BeginPaint(const gfx::Rect& damage_rect) override { |
| 7796 ++frames_began_; | 7794 ++frames_began_; |
| (...skipping 3249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11046 | 11044 |
| 11047 // Re-initialize with a software output surface. | 11045 // Re-initialize with a software output surface. |
| 11048 output_surface_ = FakeOutputSurface::CreateSoftware( | 11046 output_surface_ = FakeOutputSurface::CreateSoftware( |
| 11049 base::WrapUnique(new SoftwareOutputDevice)); | 11047 base::WrapUnique(new SoftwareOutputDevice)); |
| 11050 host_impl_->InitializeRenderer(output_surface_.get()); | 11048 host_impl_->InitializeRenderer(output_surface_.get()); |
| 11051 EXPECT_FALSE(host_impl_->use_gpu_rasterization()); | 11049 EXPECT_FALSE(host_impl_->use_gpu_rasterization()); |
| 11052 } | 11050 } |
| 11053 | 11051 |
| 11054 } // namespace | 11052 } // namespace |
| 11055 } // namespace cc | 11053 } // namespace cc |
| OLD | NEW |