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

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

Issue 2147873003: cc: Dedup IPCs to return resources to client (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 5 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 | « cc/trees/layer_tree_host_impl.cc ('k') | cc/trees/layer_tree_host_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <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
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 7725 matching lines...) Expand 10 before | Expand all | Expand 10 after
7774 7773
7775 TEST_F(CompositorFrameMetadataTest, CompositorFrameAckCountsAsSwapComplete) { 7774 TEST_F(CompositorFrameMetadataTest, CompositorFrameAckCountsAsSwapComplete) {
7776 SetupRootLayerImpl(FakeLayerWithQuads::Create(host_impl_->active_tree(), 1)); 7775 SetupRootLayerImpl(FakeLayerWithQuads::Create(host_impl_->active_tree(), 1));
7777 host_impl_->active_tree()->BuildPropertyTreesForTesting(); 7776 host_impl_->active_tree()->BuildPropertyTreesForTesting();
7778 { 7777 {
7779 LayerTreeHostImpl::FrameData frame; 7778 LayerTreeHostImpl::FrameData frame;
7780 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame)); 7779 EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
7781 host_impl_->DrawLayers(&frame); 7780 host_impl_->DrawLayers(&frame);
7782 host_impl_->DidDrawAllLayers(frame); 7781 host_impl_->DidDrawAllLayers(frame);
7783 } 7782 }
7784 CompositorFrameAck ack; 7783 host_impl_->ReclaimResources(ReturnedResourceArray());
7785 host_impl_->ReclaimResources(&ack);
7786 host_impl_->DidSwapBuffersComplete(); 7784 host_impl_->DidSwapBuffersComplete();
7787 EXPECT_EQ(swap_buffers_complete_, 1); 7785 EXPECT_EQ(swap_buffers_complete_, 1);
7788 } 7786 }
7789 7787
7790 class CountingSoftwareDevice : public SoftwareOutputDevice { 7788 class CountingSoftwareDevice : public SoftwareOutputDevice {
7791 public: 7789 public:
7792 CountingSoftwareDevice() : frames_began_(0), frames_ended_(0) {} 7790 CountingSoftwareDevice() : frames_began_(0), frames_ended_(0) {}
7793 7791
7794 SkCanvas* BeginPaint(const gfx::Rect& damage_rect) override { 7792 SkCanvas* BeginPaint(const gfx::Rect& damage_rect) override {
7795 ++frames_began_; 7793 ++frames_began_;
(...skipping 3249 matching lines...) Expand 10 before | Expand all | Expand 10 after
11045 11043
11046 // Re-initialize with a software output surface. 11044 // Re-initialize with a software output surface.
11047 output_surface_ = FakeOutputSurface::CreateSoftware( 11045 output_surface_ = FakeOutputSurface::CreateSoftware(
11048 base::WrapUnique(new SoftwareOutputDevice)); 11046 base::WrapUnique(new SoftwareOutputDevice));
11049 host_impl_->InitializeRenderer(output_surface_.get()); 11047 host_impl_->InitializeRenderer(output_surface_.get());
11050 EXPECT_FALSE(host_impl_->use_gpu_rasterization()); 11048 EXPECT_FALSE(host_impl_->use_gpu_rasterization());
11051 } 11049 }
11052 11050
11053 } // namespace 11051 } // namespace
11054 } // namespace cc 11052 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | cc/trees/layer_tree_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698