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

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

Issue 202763002: Switch to use SharedBitmapManager all the time in cc_unittests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « cc/test/pixel_test.h ('k') | cc/test/test_shared_bitmap_manager.h » ('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/pixel_test.h" 5 #include "cc/test/pixel_test.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/message_loop/message_loop_proxy.h" 8 #include "base/message_loop/message_loop_proxy.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
11 #include "cc/base/switches.h" 11 #include "cc/base/switches.h"
12 #include "cc/output/compositor_frame_metadata.h" 12 #include "cc/output/compositor_frame_metadata.h"
13 #include "cc/output/copy_output_request.h" 13 #include "cc/output/copy_output_request.h"
14 #include "cc/output/copy_output_result.h" 14 #include "cc/output/copy_output_result.h"
15 #include "cc/output/gl_renderer.h" 15 #include "cc/output/gl_renderer.h"
16 #include "cc/output/output_surface_client.h" 16 #include "cc/output/output_surface_client.h"
17 #include "cc/output/software_renderer.h" 17 #include "cc/output/software_renderer.h"
18 #include "cc/resources/resource_provider.h" 18 #include "cc/resources/resource_provider.h"
19 #include "cc/resources/texture_mailbox_deleter.h" 19 #include "cc/resources/texture_mailbox_deleter.h"
20 #include "cc/test/fake_output_surface_client.h" 20 #include "cc/test/fake_output_surface_client.h"
21 #include "cc/test/paths.h" 21 #include "cc/test/paths.h"
22 #include "cc/test/pixel_test_output_surface.h" 22 #include "cc/test/pixel_test_output_surface.h"
23 #include "cc/test/pixel_test_software_output_device.h" 23 #include "cc/test/pixel_test_software_output_device.h"
24 #include "cc/test/pixel_test_utils.h" 24 #include "cc/test/pixel_test_utils.h"
25 #include "cc/test/test_in_process_context_provider.h" 25 #include "cc/test/test_in_process_context_provider.h"
26 #include "cc/test/test_shared_bitmap_manager.h"
26 #include "testing/gtest/include/gtest/gtest.h" 27 #include "testing/gtest/include/gtest/gtest.h"
27 28
28 namespace cc { 29 namespace cc {
29 30
30 PixelTest::PixelTest() 31 PixelTest::PixelTest()
31 : device_viewport_size_(gfx::Size(200, 200)), 32 : device_viewport_size_(gfx::Size(200, 200)),
32 disable_picture_quad_image_filtering_(false), 33 disable_picture_quad_image_filtering_(false),
33 output_surface_client_(new FakeOutputSurfaceClient) {} 34 output_surface_client_(new FakeOutputSurfaceClient) {}
34 35
35 PixelTest::~PixelTest() {} 36 PixelTest::~PixelTest() {}
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 *result_bitmap_, test_data_dir.Append(ref_file), comparator); 115 *result_bitmap_, test_data_dir.Append(ref_file), comparator);
115 } 116 }
116 117
117 void PixelTest::SetUpGLRenderer(bool use_skia_gpu_backend) { 118 void PixelTest::SetUpGLRenderer(bool use_skia_gpu_backend) {
118 enable_pixel_output_.reset(new gfx::DisableNullDrawGLBindings); 119 enable_pixel_output_.reset(new gfx::DisableNullDrawGLBindings);
119 120
120 output_surface_.reset( 121 output_surface_.reset(
121 new PixelTestOutputSurface(new TestInProcessContextProvider)); 122 new PixelTestOutputSurface(new TestInProcessContextProvider));
122 output_surface_->BindToClient(output_surface_client_.get()); 123 output_surface_->BindToClient(output_surface_client_.get());
123 124
124 resource_provider_ = 125 shared_bitmap_manager_.reset(new TestSharedBitmapManager());
125 ResourceProvider::Create(output_surface_.get(), NULL, 0, false, 1); 126 resource_provider_ = ResourceProvider::Create(
127 output_surface_.get(), shared_bitmap_manager_.get(), 0, false, 1);
126 128
127 texture_mailbox_deleter_ = make_scoped_ptr( 129 texture_mailbox_deleter_ = make_scoped_ptr(
128 new TextureMailboxDeleter(base::MessageLoopProxy::current())); 130 new TextureMailboxDeleter(base::MessageLoopProxy::current()));
129 131
130 renderer_ = GLRenderer::Create(this, 132 renderer_ = GLRenderer::Create(this,
131 &settings_, 133 &settings_,
132 output_surface_.get(), 134 output_surface_.get(),
133 resource_provider_.get(), 135 resource_provider_.get(),
134 texture_mailbox_deleter_.get(), 136 texture_mailbox_deleter_.get(),
135 0).PassAs<DirectRenderer>(); 137 0).PassAs<DirectRenderer>();
(...skipping 19 matching lines...) Expand all
155 157
156 void PixelTest::EnableExternalStencilTest() { 158 void PixelTest::EnableExternalStencilTest() {
157 static_cast<PixelTestOutputSurface*>(output_surface_.get()) 159 static_cast<PixelTestOutputSurface*>(output_surface_.get())
158 ->set_has_external_stencil_test(true); 160 ->set_has_external_stencil_test(true);
159 } 161 }
160 162
161 void PixelTest::SetUpSoftwareRenderer() { 163 void PixelTest::SetUpSoftwareRenderer() {
162 scoped_ptr<SoftwareOutputDevice> device(new PixelTestSoftwareOutputDevice()); 164 scoped_ptr<SoftwareOutputDevice> device(new PixelTestSoftwareOutputDevice());
163 output_surface_.reset(new PixelTestOutputSurface(device.Pass())); 165 output_surface_.reset(new PixelTestOutputSurface(device.Pass()));
164 output_surface_->BindToClient(output_surface_client_.get()); 166 output_surface_->BindToClient(output_surface_client_.get());
165 resource_provider_ = 167 shared_bitmap_manager_.reset(new TestSharedBitmapManager());
166 ResourceProvider::Create(output_surface_.get(), NULL, 0, false, 1); 168 resource_provider_ = ResourceProvider::Create(
167 renderer_ = SoftwareRenderer::Create( 169 output_surface_.get(), shared_bitmap_manager_.get(), 0, false, 1);
168 this, &settings_, output_surface_.get(), resource_provider_.get()) 170 renderer_ =
169 .PassAs<DirectRenderer>(); 171 SoftwareRenderer::Create(
172 this, &settings_, output_surface_.get(), resource_provider_.get())
173 .PassAs<DirectRenderer>();
170 } 174 }
171 175
172 } // namespace cc 176 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/pixel_test.h ('k') | cc/test/test_shared_bitmap_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698