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(), | |
98 gfx::Size(), | 97 gfx::Size(), |
99 gpu::gles2::DisallowedFeatures(), | 98 gpu::gles2::DisallowedFeatures(), |
100 NULL, | 99 NULL, |
101 attribs)) { | 100 attribs)) { |
102 return false; | 101 return false; |
103 } | 102 } |
104 | 103 |
105 command_buffer_->SetPutOffsetChangeCallback( | 104 command_buffer_->SetPutOffsetChangeCallback( |
106 base::Bind(&GpuScheduler::PutChanged, | 105 base::Bind(&GpuScheduler::PutChanged, |
107 base::Unretained(gpu_scheduler_.get()))); | 106 base::Unretained(gpu_scheduler_.get()))); |
(...skipping 22 matching lines...) Expand all Loading... |
130 kTransferBufferSize, | 129 kTransferBufferSize, |
131 kTransferBufferSize)) { | 130 kTransferBufferSize)) { |
132 return false; | 131 return false; |
133 } | 132 } |
134 | 133 |
135 return true; | 134 return true; |
136 } | 135 } |
137 | 136 |
138 } // namespace demos | 137 } // namespace demos |
139 } // namespace gpu | 138 } // namespace gpu |
OLD | NEW |