| 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 return false; | 87 return false; |
| 88 | 88 |
| 89 context_ = gfx::GLContext::CreateGLContext( | 89 context_ = gfx::GLContext::CreateGLContext( |
| 90 NULL, surface_.get(), gfx::PreferDiscreteGpu); | 90 NULL, surface_.get(), gfx::PreferDiscreteGpu); |
| 91 if (!context_.get()) | 91 if (!context_.get()) |
| 92 return false; | 92 return false; |
| 93 | 93 |
| 94 std::vector<int32> attribs; | 94 std::vector<int32> attribs; |
| 95 if (!decoder_->Initialize(surface_.get(), | 95 if (!decoder_->Initialize(surface_.get(), |
| 96 context_.get(), | 96 context_.get(), |
| 97 surface_->IsOffscreen(), |
| 97 gfx::Size(), | 98 gfx::Size(), |
| 98 gpu::gles2::DisallowedFeatures(), | 99 gpu::gles2::DisallowedFeatures(), |
| 99 NULL, | 100 NULL, |
| 100 attribs)) { | 101 attribs)) { |
| 101 return false; | 102 return false; |
| 102 } | 103 } |
| 103 | 104 |
| 104 command_buffer_->SetPutOffsetChangeCallback( | 105 command_buffer_->SetPutOffsetChangeCallback( |
| 105 base::Bind(&GpuScheduler::PutChanged, | 106 base::Bind(&GpuScheduler::PutChanged, |
| 106 base::Unretained(gpu_scheduler_.get()))); | 107 base::Unretained(gpu_scheduler_.get()))); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 129 kTransferBufferSize, | 130 kTransferBufferSize, |
| 130 kTransferBufferSize)) { | 131 kTransferBufferSize)) { |
| 131 return false; | 132 return false; |
| 132 } | 133 } |
| 133 | 134 |
| 134 return true; | 135 return true; |
| 135 } | 136 } |
| 136 | 137 |
| 137 } // namespace demos | 138 } // namespace demos |
| 138 } // namespace gpu | 139 } // namespace gpu |
| OLD | NEW |