| 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 "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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 | 50 |
| 51 demo_->Resize(width, height); | 51 demo_->Resize(width, height); |
| 52 return demo_->InitGL(); | 52 return demo_->InitGL(); |
| 53 } | 53 } |
| 54 | 54 |
| 55 void Window::OnPaint() { | 55 void Window::OnPaint() { |
| 56 demo_->Draw(); | 56 demo_->Draw(); |
| 57 ::gles2::GetGLContext()->SwapBuffers(); | 57 ::gles2::GetGLContext()->SwapBuffers(); |
| 58 } | 58 } |
| 59 | 59 |
| 60 bool Window::CreateRenderContext(gfx::PluginWindowHandle hwnd) { | 60 bool Window::CreateRenderContext(gfx::AcceleratedWidget hwnd) { |
| 61 command_buffer_.reset(new CommandBufferService); | 61 command_buffer_.reset(new CommandBufferService); |
| 62 if (!command_buffer_->Initialize()) { | 62 if (!command_buffer_->Initialize()) { |
| 63 return false; | 63 return false; |
| 64 } | 64 } |
| 65 | 65 |
| 66 gpu::gles2::ContextGroup::Ref group(new gpu::gles2::ContextGroup(true)); | 66 gpu::gles2::ContextGroup::Ref group(new gpu::gles2::ContextGroup(true)); |
| 67 | 67 |
| 68 decoder_.reset(gpu::gles2::GLES2Decoder::Create(group.get())); | 68 decoder_.reset(gpu::gles2::GLES2Decoder::Create(group.get())); |
| 69 if (!decoder_.get()) | 69 if (!decoder_.get()) |
| 70 return false; | 70 return false; |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 kTransferBufferSize, | 121 kTransferBufferSize, |
| 122 kTransferBufferSize)) { | 122 kTransferBufferSize)) { |
| 123 return false; | 123 return false; |
| 124 } | 124 } |
| 125 | 125 |
| 126 return true; | 126 return true; |
| 127 } | 127 } |
| 128 | 128 |
| 129 } // namespace demos | 129 } // namespace demos |
| 130 } // namespace gpu | 130 } // namespace gpu |
| OLD | NEW |