OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "gpu/demos/framework/window.h" | 5 #include "gpu/demos/framework/window.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 return demo_->InitGL(); | 47 return demo_->InitGL(); |
48 } | 48 } |
49 | 49 |
50 void Window::OnPaint() { | 50 void Window::OnPaint() { |
51 demo_->Draw(); | 51 demo_->Draw(); |
52 ::gles2::GetGLContext()->SwapBuffers(); | 52 ::gles2::GetGLContext()->SwapBuffers(); |
53 } | 53 } |
54 | 54 |
55 bool Window::CreateRenderContext(gfx::PluginWindowHandle hwnd) { | 55 bool Window::CreateRenderContext(gfx::PluginWindowHandle hwnd) { |
56 command_buffer_.reset(new CommandBufferService); | 56 command_buffer_.reset(new CommandBufferService); |
57 if (!command_buffer_->Initialize(kCommandBufferSize)) { | 57 if (!command_buffer_->Initialize()) { |
58 return false; | 58 return false; |
59 } | 59 } |
60 | 60 |
61 gpu::gles2::ContextGroup::Ref group(new gpu::gles2::ContextGroup(true)); | 61 gpu::gles2::ContextGroup::Ref group(new gpu::gles2::ContextGroup(true)); |
62 | 62 |
63 decoder_.reset(gpu::gles2::GLES2Decoder::Create(group.get())); | 63 decoder_.reset(gpu::gles2::GLES2Decoder::Create(group.get())); |
64 if (!decoder_.get()) | 64 if (!decoder_.get()) |
65 return false; | 65 return false; |
66 | 66 |
67 gpu_scheduler_.reset(new gpu::GpuScheduler(command_buffer_.get(), | 67 gpu_scheduler_.reset(new gpu::GpuScheduler(command_buffer_.get(), |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 transfer_buffer.size, | 108 transfer_buffer.size, |
109 transfer_buffer.ptr, | 109 transfer_buffer.ptr, |
110 transfer_buffer_id, | 110 transfer_buffer_id, |
111 false, | 111 false, |
112 true)); | 112 true)); |
113 return true; | 113 return true; |
114 } | 114 } |
115 | 115 |
116 } // namespace demos | 116 } // namespace demos |
117 } // namespace gpu | 117 } // namespace gpu |
OLD | NEW |