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

Side by Side Diff: ui/compositor/test/default_context_factory.cc

Issue 135213003: Ensure GL initialization only happens once, and provide common init path (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: initgl: compile3 Created 6 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 | Annotate | Revision Log
« no previous file with comments | « ui/compositor/test/default_context_factory.h ('k') | ui/compositor/test/test_suite.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 "ui/compositor/test/default_context_factory.h" 5 #include "ui/compositor/test/default_context_factory.h"
6 6
7 #include "cc/output/output_surface.h" 7 #include "cc/output/output_surface.h"
8 #include "ui/compositor/reflector.h" 8 #include "ui/compositor/reflector.h"
9 #include "ui/gl/gl_implementation.h" 9 #include "ui/gl/gl_implementation.h"
10 #include "ui/gl/gl_surface.h" 10 #include "ui/gl/gl_surface.h"
11 #include "webkit/common/gpu/context_provider_in_process.h" 11 #include "webkit/common/gpu/context_provider_in_process.h"
12 #include "webkit/common/gpu/grcontext_for_webgraphicscontext3d.h" 12 #include "webkit/common/gpu/grcontext_for_webgraphicscontext3d.h"
13 #include "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl. h" 13 #include "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl. h"
14 14
15 namespace ui { 15 namespace ui {
16 16
17 DefaultContextFactory::DefaultContextFactory() { 17 DefaultContextFactory::DefaultContextFactory() {
18 DCHECK_NE(gfx::GetGLImplementation(), gfx::kGLImplementationNone);
18 } 19 }
19 20
20 DefaultContextFactory::~DefaultContextFactory() { 21 DefaultContextFactory::~DefaultContextFactory() {
21 } 22 }
22 23
23 bool DefaultContextFactory::Initialize() {
24 if (!gfx::GLSurface::InitializeOneOff() ||
25 gfx::GetGLImplementation() == gfx::kGLImplementationNone) {
26 LOG(ERROR) << "Could not load the GL bindings";
27 return false;
28 }
29 return true;
30 }
31
32 scoped_ptr<cc::OutputSurface> DefaultContextFactory::CreateOutputSurface( 24 scoped_ptr<cc::OutputSurface> DefaultContextFactory::CreateOutputSurface(
33 Compositor* compositor, bool software_fallback) { 25 Compositor* compositor, bool software_fallback) {
34 DCHECK(!software_fallback); 26 DCHECK(!software_fallback);
35 blink::WebGraphicsContext3D::Attributes attrs; 27 blink::WebGraphicsContext3D::Attributes attrs;
36 attrs.depth = false; 28 attrs.depth = false;
37 attrs.stencil = false; 29 attrs.stencil = false;
38 attrs.antialias = false; 30 attrs.antialias = false;
39 attrs.shareResources = true; 31 attrs.shareResources = true;
40 32
41 using webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl; 33 using webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 84
93 return shared_main_thread_contexts_; 85 return shared_main_thread_contexts_;
94 } 86 }
95 87
96 void DefaultContextFactory::RemoveCompositor(Compositor* compositor) { 88 void DefaultContextFactory::RemoveCompositor(Compositor* compositor) {
97 } 89 }
98 90
99 bool DefaultContextFactory::DoesCreateTestContexts() { return false; } 91 bool DefaultContextFactory::DoesCreateTestContexts() { return false; }
100 92
101 } // namespace ui 93 } // namespace ui
OLDNEW
« no previous file with comments | « ui/compositor/test/default_context_factory.h ('k') | ui/compositor/test/test_suite.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698