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 <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 decoder_.reset(gpu::gles2::GLES2Decoder::Create(group.get())); | 85 decoder_.reset(gpu::gles2::GLES2Decoder::Create(group.get())); |
86 if (!decoder_.get()) | 86 if (!decoder_.get()) |
87 return false; | 87 return false; |
88 | 88 |
89 gpu_scheduler_.reset(new gpu::GpuScheduler(command_buffer_.get(), | 89 gpu_scheduler_.reset(new gpu::GpuScheduler(command_buffer_.get(), |
90 decoder_.get(), | 90 decoder_.get(), |
91 NULL)); | 91 NULL)); |
92 | 92 |
93 decoder_->set_engine(gpu_scheduler_.get()); | 93 decoder_->set_engine(gpu_scheduler_.get()); |
94 | 94 |
95 surface_ = gfx::GLSurface::CreateViewGLSurface(false, hwnd); | 95 surface_ = gfx::GLSurface::CreateViewGLSurface(hwnd); |
96 if (!surface_.get()) | 96 if (!surface_.get()) |
97 return false; | 97 return false; |
98 | 98 |
99 context_ = gfx::GLContext::CreateGLContext( | 99 context_ = gfx::GLContext::CreateGLContext( |
100 NULL, surface_.get(), gfx::PreferDiscreteGpu); | 100 NULL, surface_.get(), gfx::PreferDiscreteGpu); |
101 if (!context_.get()) | 101 if (!context_.get()) |
102 return false; | 102 return false; |
103 | 103 |
104 context_->MakeCurrent(surface_); | 104 context_->MakeCurrent(surface_); |
105 | 105 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 kTransferBufferSize, | 142 kTransferBufferSize, |
143 kTransferBufferSize)) { | 143 kTransferBufferSize)) { |
144 return false; | 144 return false; |
145 } | 145 } |
146 | 146 |
147 return true; | 147 return true; |
148 } | 148 } |
149 | 149 |
150 } // namespace demos | 150 } // namespace demos |
151 } // namespace gpu | 151 } // namespace gpu |
OLD | NEW |