| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/compositor.h" | 5 #include "ui/compositor/compositor.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <deque> | 8 #include <deque> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 attrs.depth = false; | 244 attrs.depth = false; |
| 245 attrs.stencil = false; | 245 attrs.stencil = false; |
| 246 attrs.antialias = false; | 246 attrs.antialias = false; |
| 247 attrs.shareResources = true; | 247 attrs.shareResources = true; |
| 248 using webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl; | 248 using webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl; |
| 249 WebKit::WebGraphicsContext3D* context = | 249 WebKit::WebGraphicsContext3D* context = |
| 250 offscreen ? | 250 offscreen ? |
| 251 WebGraphicsContext3DInProcessCommandBufferImpl::CreateOffscreenContext( | 251 WebGraphicsContext3DInProcessCommandBufferImpl::CreateOffscreenContext( |
| 252 attrs) : | 252 attrs) : |
| 253 WebGraphicsContext3DInProcessCommandBufferImpl::CreateViewContext( | 253 WebGraphicsContext3DInProcessCommandBufferImpl::CreateViewContext( |
| 254 attrs, compositor->widget()); | 254 attrs, compositor->widget(), false); |
| 255 if (!context) | 255 if (!context) |
| 256 return NULL; | 256 return NULL; |
| 257 | 257 |
| 258 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 258 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 259 if (!offscreen) { | 259 if (!offscreen) { |
| 260 context->makeContextCurrent(); | 260 context->makeContextCurrent(); |
| 261 gfx::GLContext* gl_context = gfx::GLContext::GetCurrent(); | 261 gfx::GLContext* gl_context = gfx::GLContext::GetCurrent(); |
| 262 bool vsync = !command_line->HasSwitch(switches::kDisableGpuVsync); | 262 bool vsync = !command_line->HasSwitch(switches::kDisableGpuVsync); |
| 263 gl_context->SetSwapInterval(vsync ? 1 : 0); | 263 gl_context->SetSwapInterval(vsync ? 1 : 0); |
| 264 gl_context->ReleaseCurrent(NULL); | 264 gl_context->ReleaseCurrent(NULL); |
| (...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 808 COMPOSITOR_EXPORT void DisableTestCompositor() { | 808 COMPOSITOR_EXPORT void DisableTestCompositor() { |
| 809 ResetImplicitFactory(); | 809 ResetImplicitFactory(); |
| 810 g_test_compositor_enabled = false; | 810 g_test_compositor_enabled = false; |
| 811 } | 811 } |
| 812 | 812 |
| 813 COMPOSITOR_EXPORT bool IsTestCompositorEnabled() { | 813 COMPOSITOR_EXPORT bool IsTestCompositorEnabled() { |
| 814 return g_test_compositor_enabled; | 814 return g_test_compositor_enabled; |
| 815 } | 815 } |
| 816 | 816 |
| 817 } // namespace ui | 817 } // namespace ui |
| OLD | NEW |