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

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

Issue 23454014: cc: Drop ContextProvider references on the impl thread before quitting (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: callbackcontrolcenter: rebase Created 7 years, 3 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/trees/layer_tree_host_impl.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/path_service.h" 7 #include "base/path_service.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "cc/output/compositor_frame_metadata.h" 9 #include "cc/output/compositor_frame_metadata.h"
10 #include "cc/output/copy_output_request.h" 10 #include "cc/output/copy_output_request.h"
11 #include "cc/output/copy_output_result.h" 11 #include "cc/output/copy_output_result.h"
12 #include "cc/output/gl_renderer.h" 12 #include "cc/output/gl_renderer.h"
13 #include "cc/output/output_surface_client.h" 13 #include "cc/output/output_surface_client.h"
14 #include "cc/output/software_renderer.h" 14 #include "cc/output/software_renderer.h"
15 #include "cc/resources/resource_provider.h" 15 #include "cc/resources/resource_provider.h"
16 #include "cc/resources/texture_mailbox_deleter.h"
16 #include "cc/test/paths.h" 17 #include "cc/test/paths.h"
17 #include "cc/test/pixel_test_output_surface.h" 18 #include "cc/test/pixel_test_output_surface.h"
18 #include "cc/test/pixel_test_software_output_device.h" 19 #include "cc/test/pixel_test_software_output_device.h"
19 #include "cc/test/pixel_test_utils.h" 20 #include "cc/test/pixel_test_utils.h"
20 #include "testing/gtest/include/gtest/gtest.h" 21 #include "testing/gtest/include/gtest/gtest.h"
21 #include "ui/gl/gl_implementation.h" 22 #include "ui/gl/gl_implementation.h"
22 #include "webkit/common/gpu/context_provider_in_process.h" 23 #include "webkit/common/gpu/context_provider_in_process.h"
23 #include "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl. h" 24 #include "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl. h"
24 25
25 namespace cc { 26 namespace cc {
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 void PixelTest::SetUpGLRenderer(bool use_skia_gpu_backend) { 155 void PixelTest::SetUpGLRenderer(bool use_skia_gpu_backend) {
155 CHECK(fake_client_); 156 CHECK(fake_client_);
156 CHECK(gfx::InitializeGLBindings(gfx::kGLImplementationOSMesaGL)); 157 CHECK(gfx::InitializeGLBindings(gfx::kGLImplementationOSMesaGL));
157 158
158 using webkit::gpu::ContextProviderInProcess; 159 using webkit::gpu::ContextProviderInProcess;
159 output_surface_.reset(new PixelTestOutputSurface( 160 output_surface_.reset(new PixelTestOutputSurface(
160 ContextProviderInProcess::CreateOffscreen())); 161 ContextProviderInProcess::CreateOffscreen()));
161 output_surface_->BindToClient(fake_client_.get()); 162 output_surface_->BindToClient(fake_client_.get());
162 163
163 resource_provider_ = ResourceProvider::Create(output_surface_.get(), 0); 164 resource_provider_ = ResourceProvider::Create(output_surface_.get(), 0);
165
166 texture_mailbox_deleter_ = make_scoped_ptr(new TextureMailboxDeleter);
167
164 renderer_ = GLRenderer::Create(fake_client_.get(), 168 renderer_ = GLRenderer::Create(fake_client_.get(),
165 &settings_, 169 &settings_,
166 output_surface_.get(), 170 output_surface_.get(),
167 resource_provider_.get(), 171 resource_provider_.get(),
172 texture_mailbox_deleter_.get(),
168 0, 173 0,
169 use_skia_gpu_backend).PassAs<DirectRenderer>(); 174 use_skia_gpu_backend).PassAs<DirectRenderer>();
170 } 175 }
171 176
172 void PixelTest::ForceExpandedViewport(gfx::Size surface_expansion, 177 void PixelTest::ForceExpandedViewport(gfx::Size surface_expansion,
173 gfx::Vector2d viewport_offset) { 178 gfx::Vector2d viewport_offset) {
174 static_cast<PixelTestOutputSurface*>(output_surface_.get()) 179 static_cast<PixelTestOutputSurface*>(output_surface_.get())
175 ->set_surface_expansion_size(surface_expansion); 180 ->set_surface_expansion_size(surface_expansion);
176 static_cast<PixelTestOutputSurface*>(output_surface_.get()) 181 static_cast<PixelTestOutputSurface*>(output_surface_.get())
177 ->set_viewport_offset(viewport_offset); 182 ->set_viewport_offset(viewport_offset);
(...skipping 22 matching lines...) Expand all
200 output_surface_->BindToClient(fake_client_.get()); 205 output_surface_->BindToClient(fake_client_.get());
201 resource_provider_ = ResourceProvider::Create(output_surface_.get(), 0); 206 resource_provider_ = ResourceProvider::Create(output_surface_.get(), 0);
202 renderer_ = SoftwareRenderer::Create(fake_client_.get(), 207 renderer_ = SoftwareRenderer::Create(fake_client_.get(),
203 &settings_, 208 &settings_,
204 output_surface_.get(), 209 output_surface_.get(),
205 resource_provider_.get()) 210 resource_provider_.get())
206 .PassAs<DirectRenderer>(); 211 .PassAs<DirectRenderer>();
207 } 212 }
208 213
209 } // namespace cc 214 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/pixel_test.h ('k') | cc/trees/layer_tree_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698