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

Side by Side Diff: cc/test/layer_tree_pixel_test.cc

Issue 1821863002: Hook up ui::Compositor to Display's BeginFrameSource (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Display member destruction order 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
« no previous file with comments | « cc/test/fake_output_surface_client.h ('k') | cc/test/pixel_test.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 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/test/layer_tree_pixel_test.h" 5 #include "cc/test/layer_tree_pixel_test.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "base/memory/ptr_util.h"
12 #include "base/path_service.h" 11 #include "base/path_service.h"
13 #include "cc/base/switches.h" 12 #include "cc/base/switches.h"
14 #include "cc/layers/solid_color_layer.h" 13 #include "cc/layers/solid_color_layer.h"
15 #include "cc/layers/texture_layer.h" 14 #include "cc/layers/texture_layer.h"
16 #include "cc/output/copy_output_request.h" 15 #include "cc/output/copy_output_request.h"
17 #include "cc/output/copy_output_result.h" 16 #include "cc/output/copy_output_result.h"
18 #include "cc/output/direct_renderer.h" 17 #include "cc/output/direct_renderer.h"
19 #include "cc/resources/texture_mailbox.h" 18 #include "cc/resources/texture_mailbox.h"
20 #include "cc/test/paths.h" 19 #include "cc/test/paths.h"
21 #include "cc/test/pixel_comparator.h" 20 #include "cc/test/pixel_comparator.h"
(...skipping 20 matching lines...) Expand all
42 std::unique_ptr<OutputSurface> LayerTreePixelTest::CreateOutputSurface() { 41 std::unique_ptr<OutputSurface> LayerTreePixelTest::CreateOutputSurface() {
43 gfx::Size surface_expansion_size(40, 60); 42 gfx::Size surface_expansion_size(40, 60);
44 std::unique_ptr<PixelTestOutputSurface> output_surface; 43 std::unique_ptr<PixelTestOutputSurface> output_surface;
45 44
46 switch (test_type_) { 45 switch (test_type_) {
47 case PIXEL_TEST_SOFTWARE: { 46 case PIXEL_TEST_SOFTWARE: {
48 std::unique_ptr<PixelTestSoftwareOutputDevice> software_output_device( 47 std::unique_ptr<PixelTestSoftwareOutputDevice> software_output_device(
49 new PixelTestSoftwareOutputDevice); 48 new PixelTestSoftwareOutputDevice);
50 software_output_device->set_surface_expansion_size( 49 software_output_device->set_surface_expansion_size(
51 surface_expansion_size); 50 surface_expansion_size);
52 output_surface = base::WrapUnique( 51 output_surface = base::WrapUnique(new PixelTestOutputSurface(
53 new PixelTestOutputSurface(std::move(software_output_device))); 52 std::move(software_output_device), nullptr));
54 break; 53 break;
55 } 54 }
56 case PIXEL_TEST_GL: { 55 case PIXEL_TEST_GL: {
57 bool flipped_output_surface = false; 56 bool flipped_output_surface = false;
58 scoped_refptr<TestInProcessContextProvider> compositor( 57 scoped_refptr<TestInProcessContextProvider> compositor(
59 new TestInProcessContextProvider(nullptr)); 58 new TestInProcessContextProvider(nullptr));
60 scoped_refptr<TestInProcessContextProvider> worker( 59 scoped_refptr<TestInProcessContextProvider> worker(
61 new TestInProcessContextProvider(compositor.get())); 60 new TestInProcessContextProvider(compositor.get()));
62 output_surface = base::WrapUnique(new PixelTestOutputSurface( 61 output_surface = base::WrapUnique(
63 std::move(compositor), std::move(worker), flipped_output_surface)); 62 new PixelTestOutputSurface(std::move(compositor), std::move(worker),
63 flipped_output_surface, nullptr));
64 break; 64 break;
65 } 65 }
66 } 66 }
67 67
68 output_surface->set_surface_expansion_size(surface_expansion_size); 68 output_surface->set_surface_expansion_size(surface_expansion_size);
69 return std::move(output_surface); 69 return std::move(output_surface);
70 } 70 }
71 71
72 void LayerTreePixelTest::WillCommitCompleteOnThread(LayerTreeHostImpl* impl) { 72 void LayerTreePixelTest::WillCommitCompleteOnThread(LayerTreeHostImpl* impl) {
73 if (impl->sync_tree()->source_frame_number() != 0) 73 if (impl->sync_tree()->source_frame_number() != 0)
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 } 276 }
277 277
278 void LayerTreePixelTest::Finish() { 278 void LayerTreePixelTest::Finish() {
279 std::unique_ptr<gpu::GLInProcessContext> context = 279 std::unique_ptr<gpu::GLInProcessContext> context =
280 CreateTestInProcessContext(); 280 CreateTestInProcessContext();
281 GLES2Interface* gl = context->GetImplementation(); 281 GLES2Interface* gl = context->GetImplementation();
282 gl->Finish(); 282 gl->Finish();
283 } 283 }
284 284
285 } // namespace cc 285 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/fake_output_surface_client.h ('k') | cc/test/pixel_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698