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/gles2_conform_support/egl/display.h" | 5 #include "gpu/gles2_conform_support/egl/display.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
10 #include "gpu/command_buffer/client/gles2_lib.h" | 10 #include "gpu/command_buffer/client/gles2_lib.h" |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 | 105 |
106 gl_context_ = gfx::GLContext::CreateGLContext(NULL, | 106 gl_context_ = gfx::GLContext::CreateGLContext(NULL, |
107 gl_surface_.get(), | 107 gl_surface_.get(), |
108 gfx::PreferDiscreteGpu); | 108 gfx::PreferDiscreteGpu); |
109 if (!gl_context_.get()) | 109 if (!gl_context_.get()) |
110 return EGL_NO_SURFACE; | 110 return EGL_NO_SURFACE; |
111 | 111 |
112 std::vector<int32> attribs; | 112 std::vector<int32> attribs; |
113 if (!decoder_->Initialize(gl_surface_.get(), | 113 if (!decoder_->Initialize(gl_surface_.get(), |
114 gl_context_.get(), | 114 gl_context_.get(), |
115 gl_surface_->IsOffscreen(), | |
116 gfx::Size(), | 115 gfx::Size(), |
117 gpu::gles2::DisallowedFeatures(), | 116 gpu::gles2::DisallowedFeatures(), |
118 NULL, | 117 NULL, |
119 attribs)) { | 118 attribs)) { |
120 return EGL_NO_SURFACE; | 119 return EGL_NO_SURFACE; |
121 } | 120 } |
122 | 121 |
123 command_buffer->SetPutOffsetChangeCallback( | 122 command_buffer->SetPutOffsetChangeCallback( |
124 base::Bind(&gpu::GpuScheduler::PutChanged, | 123 base::Bind(&gpu::GpuScheduler::PutChanged, |
125 base::Unretained(gpu_scheduler_.get()))); | 124 base::Unretained(gpu_scheduler_.get()))); |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 } else { | 206 } else { |
208 DCHECK(IsValidSurface(draw)); | 207 DCHECK(IsValidSurface(draw)); |
209 DCHECK(IsValidSurface(read)); | 208 DCHECK(IsValidSurface(read)); |
210 DCHECK(IsValidContext(ctx)); | 209 DCHECK(IsValidContext(ctx)); |
211 gles2::SetGLContext(context_.get()); | 210 gles2::SetGLContext(context_.get()); |
212 } | 211 } |
213 return true; | 212 return true; |
214 } | 213 } |
215 | 214 |
216 } // namespace egl | 215 } // namespace egl |
OLD | NEW |