Chromium Code Reviews| 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 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/threading/thread_restrictions.h" | 10 #include "base/threading/thread_restrictions.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 96 | 96 |
| 97 WebKit::WebGraphicsContext3D* DefaultContextFactory::CreateContextCommon( | 97 WebKit::WebGraphicsContext3D* DefaultContextFactory::CreateContextCommon( |
| 98 Compositor* compositor, | 98 Compositor* compositor, |
| 99 bool offscreen) { | 99 bool offscreen) { |
| 100 DCHECK(offscreen || compositor); | 100 DCHECK(offscreen || compositor); |
| 101 WebKit::WebGraphicsContext3D::Attributes attrs; | 101 WebKit::WebGraphicsContext3D::Attributes attrs; |
| 102 attrs.depth = false; | 102 attrs.depth = false; |
| 103 attrs.stencil = false; | 103 attrs.stencil = false; |
| 104 attrs.antialias = false; | 104 attrs.antialias = false; |
| 105 attrs.shareResources = true; | 105 attrs.shareResources = true; |
| 106 attrs.noAutomaticFlushes = !offscreen; | |
|
piman
2012/10/16 03:07:14
It's ignored anyway by WebGraphicsContext3DInProce
| |
| 106 WebKit::WebGraphicsContext3D* context = | 107 WebKit::WebGraphicsContext3D* context = |
| 107 offscreen ? | 108 offscreen ? |
| 108 webkit::gpu::WebGraphicsContext3DInProcessImpl::CreateForWebView( | 109 webkit::gpu::WebGraphicsContext3DInProcessImpl::CreateForWebView( |
| 109 attrs, false) : | 110 attrs, false) : |
| 110 webkit::gpu::WebGraphicsContext3DInProcessImpl::CreateForWindow( | 111 webkit::gpu::WebGraphicsContext3DInProcessImpl::CreateForWindow( |
| 111 attrs, compositor->widget(), share_group_.get()); | 112 attrs, compositor->widget(), share_group_.get()); |
| 112 if (!context) | 113 if (!context) |
| 113 return NULL; | 114 return NULL; |
| 114 | 115 |
| 115 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 116 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 436 | 437 |
| 437 COMPOSITOR_EXPORT void DisableTestCompositor() { | 438 COMPOSITOR_EXPORT void DisableTestCompositor() { |
| 438 test_compositor_enabled = false; | 439 test_compositor_enabled = false; |
| 439 } | 440 } |
| 440 | 441 |
| 441 COMPOSITOR_EXPORT bool IsTestCompositorEnabled() { | 442 COMPOSITOR_EXPORT bool IsTestCompositorEnabled() { |
| 442 return test_compositor_enabled; | 443 return test_compositor_enabled; |
| 443 } | 444 } |
| 444 | 445 |
| 445 } // namespace ui | 446 } // namespace ui |
| OLD | NEW |