| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "mojo/services/gles2/gles2_impl.h" | 5 #include "mojo/services/gles2/gles2_impl.h" |
| 6 | 6 |
| 7 #include <stdio.h> | 7 #include <stdio.h> |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "gpu/command_buffer/client/gl_in_process_context.h" | 9 #include "gpu/command_buffer/client/gl_in_process_context.h" |
| 10 #include "gpu/command_buffer/client/gles2_implementation.h" | 10 #include "gpu/command_buffer/client/gles2_implementation.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 const gfx::Size& size) { | 36 const gfx::Size& size) { |
| 37 gpu::GLInProcessContextAttribs attribs; | 37 gpu::GLInProcessContextAttribs attribs; |
| 38 gl_context_.reset(gpu::GLInProcessContext::CreateContext( | 38 gl_context_.reset(gpu::GLInProcessContext::CreateContext( |
| 39 false, widget, size, false, attribs, gfx::PreferDiscreteGpu)); | 39 false, widget, size, false, attribs, gfx::PreferDiscreteGpu)); |
| 40 gl_context_->SetContextLostCallback(base::Bind( | 40 gl_context_->SetContextLostCallback(base::Bind( |
| 41 &GLES2Impl::OnGLContextLost, base::Unretained(this))); | 41 &GLES2Impl::OnGLContextLost, base::Unretained(this))); |
| 42 | 42 |
| 43 gpu::gles2::GLES2Interface* gl = gl_context_->GetImplementation(); | 43 gpu::gles2::GLES2Interface* gl = gl_context_->GetImplementation(); |
| 44 uint64_t encoded_gl = static_cast<uint64_t>(reinterpret_cast<uintptr_t>(gl)); | 44 uint64_t encoded_gl = static_cast<uint64_t>(reinterpret_cast<uintptr_t>(gl)); |
| 45 | 45 |
| 46 client_->DidCreateContext(encoded_gl, size.width(), size.height()); | 46 client_->DidCreateContext(encoded_gl); |
| 47 } | 47 } |
| 48 | 48 |
| 49 void GLES2Impl::OnGLContextLost() { | 49 void GLES2Impl::OnGLContextLost() { |
| 50 client_->ContextLost(); | 50 client_->ContextLost(); |
| 51 } | 51 } |
| 52 | 52 |
| 53 void GLES2Impl::DrawAnimationFrame() { | 53 void GLES2Impl::DrawAnimationFrame() { |
| 54 client_->DrawAnimationFrame(); | 54 client_->DrawAnimationFrame(); |
| 55 } | 55 } |
| 56 | 56 |
| 57 } // namespace services | 57 } // namespace services |
| 58 } // namespace mojo | 58 } // namespace mojo |
| OLD | NEW |