OLD | NEW |
---|---|
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 <windows.h> | 5 #include <windows.h> |
6 | 6 |
7 #include "app/gfx/gl/gl_context.h" | 7 #include "app/gfx/gl/gl_context.h" |
8 #include "gpu/command_buffer/service/gpu_processor.h" | 8 #include "gpu/command_buffer/service/gpu_processor.h" |
9 | 9 |
10 using ::base::SharedMemory; | 10 using ::base::SharedMemory; |
11 | 11 |
12 namespace gpu { | 12 namespace gpu { |
13 | 13 |
14 bool GPUProcessor::Initialize(gfx::PluginWindowHandle window, | 14 bool GPUProcessor::Initialize(gfx::PluginWindowHandle window, |
15 const gfx::Size& size, | 15 const gfx::Size& size, |
16 const gles2::DisallowedExtensions& disallowed, | |
16 const char* allowed_extensions, | 17 const char* allowed_extensions, |
17 const std::vector<int32>& attribs, | 18 const std::vector<int32>& attribs, |
18 GPUProcessor* parent, | 19 GPUProcessor* parent, |
19 uint32 parent_texture_id) { | 20 uint32 parent_texture_id) { |
20 // Get the parent decoder and the GLContext to share IDs with, if any. | 21 // Get the parent decoder and the GLContext to share IDs with, if any. |
21 gles2::GLES2Decoder* parent_decoder = NULL; | 22 gles2::GLES2Decoder* parent_decoder = NULL; |
22 gfx::GLContext* parent_context = NULL; | 23 gfx::GLContext* parent_context = NULL; |
23 if (parent) { | 24 if (parent) { |
24 parent_decoder = parent->decoder_.get(); | 25 parent_decoder = parent->decoder_.get(); |
25 DCHECK(parent_decoder); | 26 DCHECK(parent_decoder); |
(...skipping 11 matching lines...) Expand all Loading... | |
37 context.reset(gfx::GLContext::CreateViewGLContext(window, false)); | 38 context.reset(gfx::GLContext::CreateViewGLContext(window, false)); |
38 } else { | 39 } else { |
39 context.reset(gfx::GLContext::CreateOffscreenGLContext(parent_context)); | 40 context.reset(gfx::GLContext::CreateOffscreenGLContext(parent_context)); |
40 } | 41 } |
41 | 42 |
42 if (!context.get()) | 43 if (!context.get()) |
43 return false; | 44 return false; |
44 | 45 |
45 return InitializeCommon(context.release(), | 46 return InitializeCommon(context.release(), |
46 size, | 47 size, |
48 disallowed | |
zmo
2011/03/07 23:34:29
missing "," here. You should use the trybots. Th
| |
47 allowed_extensions, | 49 allowed_extensions, |
48 attribs, | 50 attribs, |
49 parent_decoder, | 51 parent_decoder, |
50 parent_texture_id); | 52 parent_texture_id); |
51 } | 53 } |
52 | 54 |
53 void GPUProcessor::Destroy() { | 55 void GPUProcessor::Destroy() { |
54 DestroyCommon(); | 56 DestroyCommon(); |
55 } | 57 } |
56 | 58 |
57 void GPUProcessor::WillSwapBuffers() { | 59 void GPUProcessor::WillSwapBuffers() { |
58 if (wrapped_swap_buffers_callback_.get()) { | 60 if (wrapped_swap_buffers_callback_.get()) { |
59 wrapped_swap_buffers_callback_->Run(); | 61 wrapped_swap_buffers_callback_->Run(); |
60 } | 62 } |
61 } | 63 } |
62 | 64 |
63 } // namespace gpu | 65 } // namespace gpu |
OLD | NEW |