| 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_implementation.h" | 10 #include "gpu/command_buffer/client/gles2_implementation.h" |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 if (!decoder_.get()) | 119 if (!decoder_.get()) |
| 120 return EGL_NO_SURFACE; | 120 return EGL_NO_SURFACE; |
| 121 | 121 |
| 122 gpu_scheduler_.reset(new gpu::GpuScheduler(command_buffer.get(), | 122 gpu_scheduler_.reset(new gpu::GpuScheduler(command_buffer.get(), |
| 123 decoder_.get(), | 123 decoder_.get(), |
| 124 NULL)); | 124 NULL)); |
| 125 | 125 |
| 126 decoder_->set_engine(gpu_scheduler_.get()); | 126 decoder_->set_engine(gpu_scheduler_.get()); |
| 127 gfx::Size size(create_offscreen_width_, create_offscreen_height_); | 127 gfx::Size size(create_offscreen_width_, create_offscreen_height_); |
| 128 if (create_offscreen_) { | 128 if (create_offscreen_) { |
| 129 gl_surface_ = gfx::GLSurface::CreateOffscreenGLSurface(false, size); | 129 gl_surface_ = gfx::GLSurface::CreateOffscreenGLSurface(size); |
| 130 create_offscreen_ = false; | 130 create_offscreen_ = false; |
| 131 create_offscreen_width_ = 0; | 131 create_offscreen_width_ = 0; |
| 132 create_offscreen_height_ = 0; | 132 create_offscreen_height_ = 0; |
| 133 } else { | 133 } else { |
| 134 gl_surface_ = gfx::GLSurface::CreateViewGLSurface(false, win); | 134 gl_surface_ = gfx::GLSurface::CreateViewGLSurface(win); |
| 135 } | 135 } |
| 136 if (!gl_surface_.get()) | 136 if (!gl_surface_.get()) |
| 137 return EGL_NO_SURFACE; | 137 return EGL_NO_SURFACE; |
| 138 | 138 |
| 139 gl_context_ = gfx::GLContext::CreateGLContext(NULL, | 139 gl_context_ = gfx::GLContext::CreateGLContext(NULL, |
| 140 gl_surface_.get(), | 140 gl_surface_.get(), |
| 141 gfx::PreferDiscreteGpu); | 141 gfx::PreferDiscreteGpu); |
| 142 if (!gl_context_.get()) | 142 if (!gl_context_.get()) |
| 143 return EGL_NO_SURFACE; | 143 return EGL_NO_SURFACE; |
| 144 | 144 |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 } else { | 258 } else { |
| 259 DCHECK(IsValidSurface(draw)); | 259 DCHECK(IsValidSurface(draw)); |
| 260 DCHECK(IsValidSurface(read)); | 260 DCHECK(IsValidSurface(read)); |
| 261 DCHECK(IsValidContext(ctx)); | 261 DCHECK(IsValidContext(ctx)); |
| 262 gles2::SetGLContext(context_.get()); | 262 gles2::SetGLContext(context_.get()); |
| 263 } | 263 } |
| 264 return true; | 264 return true; |
| 265 } | 265 } |
| 266 | 266 |
| 267 } // namespace egl | 267 } // namespace egl |
| OLD | NEW |