| 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/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "gpu/command_buffer/client/gles2_implementation.h" | 10 #include "gpu/command_buffer/client/gles2_implementation.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 return demo_->InitGL(); | 46 return demo_->InitGL(); |
| 47 } | 47 } |
| 48 | 48 |
| 49 void Window::OnPaint() { | 49 void Window::OnPaint() { |
| 50 demo_->Draw(); | 50 demo_->Draw(); |
| 51 ::gles2::GetGLContext()->SwapBuffers(); | 51 ::gles2::GetGLContext()->SwapBuffers(); |
| 52 } | 52 } |
| 53 | 53 |
| 54 bool Window::CreateRenderContext(gfx::PluginWindowHandle hwnd) { | 54 bool Window::CreateRenderContext(gfx::PluginWindowHandle hwnd) { |
| 55 command_buffer_.reset(new CommandBufferService); | 55 command_buffer_.reset(new CommandBufferService); |
| 56 if (!command_buffer_->Initialize(kCommandBufferSize)) { | 56 if (!command_buffer_->Initialize()) { |
| 57 return false; | 57 return false; |
| 58 } | 58 } |
| 59 | 59 |
| 60 gpu::gles2::ContextGroup::Ref group(new gpu::gles2::ContextGroup(true)); | 60 gpu::gles2::ContextGroup::Ref group(new gpu::gles2::ContextGroup(true)); |
| 61 | 61 |
| 62 decoder_.reset(gpu::gles2::GLES2Decoder::Create(group.get())); | 62 decoder_.reset(gpu::gles2::GLES2Decoder::Create(group.get())); |
| 63 if (!decoder_.get()) | 63 if (!decoder_.get()) |
| 64 return false; | 64 return false; |
| 65 | 65 |
| 66 gpu_scheduler_.reset(new gpu::GpuScheduler(command_buffer_.get(), | 66 gpu_scheduler_.reset(new gpu::GpuScheduler(command_buffer_.get(), |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 transfer_buffer.size, | 106 transfer_buffer.size, |
| 107 transfer_buffer.ptr, | 107 transfer_buffer.ptr, |
| 108 transfer_buffer_id, | 108 transfer_buffer_id, |
| 109 false, | 109 false, |
| 110 true)); | 110 true)); |
| 111 return true; | 111 return true; |
| 112 } | 112 } |
| 113 | 113 |
| 114 } // namespace demos | 114 } // namespace demos |
| 115 } // namespace gpu | 115 } // namespace gpu |
| OLD | NEW |