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

Side by Side Diff: cc/surfaces/surface_display_output_surface_unittest.cc

Issue 1435133004: cc: Clean up max frames/swaps pending usage. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 1 month 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/surfaces/surface_display_output_surface.h" 5 #include "cc/surfaces/surface_display_output_surface.h"
6 6
7 #include "cc/surfaces/onscreen_display_client.h" 7 #include "cc/surfaces/onscreen_display_client.h"
8 #include "cc/surfaces/surface_id_allocator.h" 8 #include "cc/surfaces/surface_id_allocator.h"
9 #include "cc/surfaces/surface_manager.h" 9 #include "cc/surfaces/surface_manager.h"
10 #include "cc/test/fake_output_surface.h" 10 #include "cc/test/fake_output_surface.h"
(...skipping 18 matching lines...) Expand all
29 : OnscreenDisplayClient(FakeOutputSurface::Create3d(), 29 : OnscreenDisplayClient(FakeOutputSurface::Create3d(),
30 manager, 30 manager,
31 bitmap_manager, 31 bitmap_manager,
32 gpu_memory_buffer_manager, 32 gpu_memory_buffer_manager,
33 settings, 33 settings,
34 task_runner) { 34 task_runner) {
35 // Ownership is passed to another object later, store a pointer 35 // Ownership is passed to another object later, store a pointer
36 // to it now for future reference. 36 // to it now for future reference.
37 fake_output_surface_ = 37 fake_output_surface_ =
38 static_cast<FakeOutputSurface*>(output_surface_.get()); 38 static_cast<FakeOutputSurface*>(output_surface_.get());
39 fake_output_surface_->set_max_frames_pending(2);
39 } 40 }
40 41
41 FakeOutputSurface* output_surface() { return fake_output_surface_; } 42 FakeOutputSurface* output_surface() { return fake_output_surface_; }
42 43
43 protected: 44 protected:
44 FakeOutputSurface* fake_output_surface_; 45 FakeOutputSurface* fake_output_surface_;
45 }; 46 };
46 47
47 class SurfaceDisplayOutputSurfaceTest : public testing::Test { 48 class SurfaceDisplayOutputSurfaceTest : public testing::Test {
48 public: 49 public:
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 EXPECT_EQ(1u, output_surface_->num_sent_frames()); 157 EXPECT_EQ(1u, output_surface_->num_sent_frames());
157 158
158 SwapBuffersWithDamage(gfx::Rect()); 159 SwapBuffersWithDamage(gfx::Rect());
159 EXPECT_EQ(1u, output_surface_->num_sent_frames()); 160 EXPECT_EQ(1u, output_surface_->num_sent_frames());
160 task_runner_->RunUntilIdle(); 161 task_runner_->RunUntilIdle();
161 EXPECT_EQ(1u, output_surface_->num_sent_frames()); 162 EXPECT_EQ(1u, output_surface_->num_sent_frames());
162 } 163 }
163 164
164 } // namespace 165 } // namespace
165 } // namespace cc 166 } // namespace cc
OLDNEW
« no previous file with comments | « cc/surfaces/surface_display_output_surface.cc ('k') | cc/test/fake_layer_tree_host_impl_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698