| 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(), |
| 115 gfx::Size(), | 116 gfx::Size(), |
| 116 gpu::gles2::DisallowedFeatures(), | 117 gpu::gles2::DisallowedFeatures(), |
| 117 NULL, | 118 NULL, |
| 118 attribs)) { | 119 attribs)) { |
| 119 return EGL_NO_SURFACE; | 120 return EGL_NO_SURFACE; |
| 120 } | 121 } |
| 121 | 122 |
| 122 command_buffer->SetPutOffsetChangeCallback( | 123 command_buffer->SetPutOffsetChangeCallback( |
| 123 base::Bind(&gpu::GpuScheduler::PutChanged, | 124 base::Bind(&gpu::GpuScheduler::PutChanged, |
| 124 base::Unretained(gpu_scheduler_.get()))); | 125 base::Unretained(gpu_scheduler_.get()))); |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 } else { | 207 } else { |
| 207 DCHECK(IsValidSurface(draw)); | 208 DCHECK(IsValidSurface(draw)); |
| 208 DCHECK(IsValidSurface(read)); | 209 DCHECK(IsValidSurface(read)); |
| 209 DCHECK(IsValidContext(ctx)); | 210 DCHECK(IsValidContext(ctx)); |
| 210 gles2::SetGLContext(context_.get()); | 211 gles2::SetGLContext(context_.get()); |
| 211 } | 212 } |
| 212 return true; | 213 return true; |
| 213 } | 214 } |
| 214 | 215 |
| 215 } // namespace egl | 216 } // namespace egl |
| OLD | NEW |