| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/gles2/gles2_client_impl.h" | 5 #include "mojo/gles2/gles2_client_impl.h" |
| 6 | 6 |
| 7 #include <GLES2/gl2.h> | 7 #include <GLES2/gl2.h> |
| 8 #include <GLES2/gl2ext.h> | 8 #include <GLES2/gl2ext.h> |
| 9 | 9 |
| 10 #include "mojo/public/gles2/gles2.h" | 10 #include "mojo/public/gles2/gles2.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 } | 31 } |
| 32 | 32 |
| 33 void GLES2ClientImpl::RequestAnimationFrames() { | 33 void GLES2ClientImpl::RequestAnimationFrames() { |
| 34 service_->RequestAnimationFrames(); | 34 service_->RequestAnimationFrames(); |
| 35 } | 35 } |
| 36 | 36 |
| 37 void GLES2ClientImpl::CancelAnimationFrames() { | 37 void GLES2ClientImpl::CancelAnimationFrames() { |
| 38 service_->CancelAnimationFrames(); | 38 service_->CancelAnimationFrames(); |
| 39 } | 39 } |
| 40 | 40 |
| 41 void GLES2ClientImpl::DidCreateContext(uint64_t encoded, | 41 void GLES2ClientImpl::DidCreateContext(uint64_t encoded) { |
| 42 uint32_t width, | |
| 43 uint32_t height) { | |
| 44 // Ack, Hans! It's the giant hack. | 42 // Ack, Hans! It's the giant hack. |
| 45 // TODO(abarth): Replace this hack with something more disciplined. Most | 43 // TODO(abarth): Replace this hack with something more disciplined. Most |
| 46 // likley, we should receive a MojoHandle that we use to wire up the | 44 // likley, we should receive a MojoHandle that we use to wire up the |
| 47 // client side of an out-of-process command buffer. Given that we're | 45 // client side of an out-of-process command buffer. Given that we're |
| 48 // still in-process, we just reinterpret_cast the value into a GL interface. | 46 // still in-process, we just reinterpret_cast the value into a GL interface. |
| 49 implementation_ = reinterpret_cast<gpu::gles2::GLES2Implementation*>( | 47 implementation_ = reinterpret_cast<gpu::gles2::GLES2Implementation*>( |
| 50 static_cast<uintptr_t>(encoded)); | 48 static_cast<uintptr_t>(encoded)); |
| 51 created_callback_(closure_, width, height); | 49 created_callback_(closure_); |
| 52 } | 50 } |
| 53 | 51 |
| 54 void GLES2ClientImpl::ContextLost() { | 52 void GLES2ClientImpl::ContextLost() { |
| 55 lost_callback_(closure_); | 53 lost_callback_(closure_); |
| 56 } | 54 } |
| 57 | 55 |
| 58 void GLES2ClientImpl::DrawAnimationFrame() { | 56 void GLES2ClientImpl::DrawAnimationFrame() { |
| 59 animation_callback_(closure_); | 57 animation_callback_(closure_); |
| 60 } | 58 } |
| 61 | 59 |
| 62 } // namespace examples | 60 } // namespace examples |
| 63 } // namespace mojo | 61 } // namespace mojo |
| OLD | NEW |