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

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

Issue 916723002: cc: Add threaded GPU rasterization. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Implement ContextProviderInProcess::DetachFromThread(). Created 5 years, 10 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 23 matching lines...) Expand all
34 34
35 TestOutputSurface(scoped_refptr<ContextProvider> context_provider, 35 TestOutputSurface(scoped_refptr<ContextProvider> context_provider,
36 scoped_ptr<SoftwareOutputDevice> software_device) 36 scoped_ptr<SoftwareOutputDevice> software_device)
37 : OutputSurface(context_provider, software_device.Pass()) {} 37 : OutputSurface(context_provider, software_device.Pass()) {}
38 38
39 void SwapBuffers(CompositorFrame* frame) override { 39 void SwapBuffers(CompositorFrame* frame) override {
40 client_->DidSwapBuffers(); 40 client_->DidSwapBuffers();
41 client_->DidSwapBuffersComplete(); 41 client_->DidSwapBuffersComplete();
42 } 42 }
43 43
44 bool InitializeNewContext3d( 44 bool InitializeNewContext3d(scoped_refptr<ContextProvider> context_provider) {
45 scoped_refptr<ContextProvider> new_context_provider) { 45 return InitializeAndSetContext3d(context_provider, nullptr);
46 return InitializeAndSetContext3d(new_context_provider);
47 } 46 }
48 47
49 using OutputSurface::ReleaseGL; 48 using OutputSurface::ReleaseGL;
50 49
51 void CommitVSyncParametersForTesting(base::TimeTicks timebase, 50 void CommitVSyncParametersForTesting(base::TimeTicks timebase,
52 base::TimeDelta interval) { 51 base::TimeDelta interval) {
53 CommitVSyncParameters(timebase, interval); 52 CommitVSyncParameters(timebase, interval);
54 } 53 }
55 54
56 void DidSwapBuffersForTesting() { client_->DidSwapBuffers(); } 55 void DidSwapBuffersForTesting() { client_->DidSwapBuffers(); }
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 EXPECT_EQ(1, software_output_device->ensure_backbuffer_count()); 259 EXPECT_EQ(1, software_output_device->ensure_backbuffer_count());
261 EXPECT_EQ(0, software_output_device->discard_backbuffer_count()); 260 EXPECT_EQ(0, software_output_device->discard_backbuffer_count());
262 output_surface.DiscardBackbuffer(); 261 output_surface.DiscardBackbuffer();
263 262
264 EXPECT_EQ(1, software_output_device->ensure_backbuffer_count()); 263 EXPECT_EQ(1, software_output_device->ensure_backbuffer_count());
265 EXPECT_EQ(1, software_output_device->discard_backbuffer_count()); 264 EXPECT_EQ(1, software_output_device->discard_backbuffer_count());
266 } 265 }
267 266
268 } // namespace 267 } // namespace
269 } // namespace cc 268 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698