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

Side by Side Diff: cc/output/output_surface_unittest.cc

Issue 1821863002: Hook up ui::Compositor to Display's BeginFrameSource (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Really revert task runner changes Created 4 years, 8 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/output/output_surface.h" 5 #include "cc/output/output_surface.h"
6 6
7 #include "base/test/test_simple_task_runner.h" 7 #include "base/test/test_simple_task_runner.h"
8 #include "cc/output/managed_memory_policy.h" 8 #include "cc/output/managed_memory_policy.h"
9 #include "cc/output/output_surface_client.h" 9 #include "cc/output/output_surface_client.h"
10 #include "cc/output/software_output_device.h" 10 #include "cc/output/software_output_device.h"
(...skipping 22 matching lines...) Expand all
33 33
34 TestOutputSurface(scoped_refptr<ContextProvider> context_provider, 34 TestOutputSurface(scoped_refptr<ContextProvider> context_provider,
35 scoped_ptr<SoftwareOutputDevice> software_device) 35 scoped_ptr<SoftwareOutputDevice> software_device)
36 : OutputSurface(context_provider, std::move(software_device)) {} 36 : OutputSurface(context_provider, std::move(software_device)) {}
37 37
38 void SwapBuffers(CompositorFrame* frame) override { 38 void SwapBuffers(CompositorFrame* frame) override {
39 client_->DidSwapBuffers(); 39 client_->DidSwapBuffers();
40 client_->DidSwapBuffersComplete(); 40 client_->DidSwapBuffersComplete();
41 } 41 }
42 42
43 void CommitVSyncParametersForTesting(base::TimeTicks timebase,
44 base::TimeDelta interval) {
45 CommitVSyncParameters(timebase, interval);
46 }
47
48 void DidSwapBuffersForTesting() { client_->DidSwapBuffers(); } 43 void DidSwapBuffersForTesting() { client_->DidSwapBuffers(); }
49 44
50 void OnSwapBuffersCompleteForTesting() { client_->DidSwapBuffersComplete(); } 45 void OnSwapBuffersCompleteForTesting() { client_->DidSwapBuffersComplete(); }
51 46
52 protected: 47 protected:
53 }; 48 };
54 49
55 class TestSoftwareOutputDevice : public SoftwareOutputDevice { 50 class TestSoftwareOutputDevice : public SoftwareOutputDevice {
56 public: 51 public:
57 TestSoftwareOutputDevice(); 52 TestSoftwareOutputDevice();
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 EXPECT_EQ(1, software_output_device->ensure_backbuffer_count()); 162 EXPECT_EQ(1, software_output_device->ensure_backbuffer_count());
168 EXPECT_EQ(0, software_output_device->discard_backbuffer_count()); 163 EXPECT_EQ(0, software_output_device->discard_backbuffer_count());
169 output_surface.DiscardBackbuffer(); 164 output_surface.DiscardBackbuffer();
170 165
171 EXPECT_EQ(1, software_output_device->ensure_backbuffer_count()); 166 EXPECT_EQ(1, software_output_device->ensure_backbuffer_count());
172 EXPECT_EQ(1, software_output_device->discard_backbuffer_count()); 167 EXPECT_EQ(1, software_output_device->discard_backbuffer_count());
173 } 168 }
174 169
175 } // namespace 170 } // namespace
176 } // namespace cc 171 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698