| 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 <stdio.h> | 5 #include <stdio.h> |
| 6 #include <string> | 6 #include <string> |
| 7 | 7 |
| 8 #include "mojo/examples/sample_app/gles2_client_impl.h" | 8 #include "mojo/examples/sample_app/gles2_client_impl.h" |
| 9 #include "mojo/public/bindings/lib/remote_ptr.h" | 9 #include "mojo/public/bindings/lib/remote_ptr.h" |
| 10 #include "mojo/public/environment/environment.h" | 10 #include "mojo/public/environment/environment.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 virtual ~NativeViewportClientImpl() {} | 69 virtual ~NativeViewportClientImpl() {} |
| 70 | 70 |
| 71 virtual void OnCreated() MOJO_OVERRIDE { | 71 virtual void OnCreated() MOJO_OVERRIDE { |
| 72 } | 72 } |
| 73 | 73 |
| 74 virtual void OnDestroyed() MOJO_OVERRIDE { | 74 virtual void OnDestroyed() MOJO_OVERRIDE { |
| 75 RunLoop::current()->Quit(); | 75 RunLoop::current()->Quit(); |
| 76 } | 76 } |
| 77 | 77 |
| 78 virtual void OnBoundsChanged(const Rect& bounds) MOJO_OVERRIDE { | 78 virtual void OnBoundsChanged(const Rect& bounds) MOJO_OVERRIDE { |
| 79 gles2_client_->SetSize(bounds.size()); |
| 79 } | 80 } |
| 80 | 81 |
| 81 virtual void OnEvent(const Event& event) MOJO_OVERRIDE { | 82 virtual void OnEvent(const Event& event) MOJO_OVERRIDE { |
| 82 if (!event.location().is_null()) { | 83 if (!event.location().is_null()) { |
| 83 gles2_client_->HandleInputEvent(event); | 84 gles2_client_->HandleInputEvent(event); |
| 84 viewport_->AckEvent(event); | 85 viewport_->AckEvent(event); |
| 85 } | 86 } |
| 86 } | 87 } |
| 87 | 88 |
| 88 private: | 89 private: |
| (...skipping 12 matching lines...) Expand all Loading... |
| 101 mojo::Environment env; | 102 mojo::Environment env; |
| 102 mojo::RunLoop loop; | 103 mojo::RunLoop loop; |
| 103 mojo::GLES2Initializer gles2; | 104 mojo::GLES2Initializer gles2; |
| 104 | 105 |
| 105 mojo::examples::SampleApp app( | 106 mojo::examples::SampleApp app( |
| 106 mojo::MakeScopedHandle(mojo::MessagePipeHandle(shell_handle)).Pass()); | 107 mojo::MakeScopedHandle(mojo::MessagePipeHandle(shell_handle)).Pass()); |
| 107 loop.Run(); | 108 loop.Run(); |
| 108 | 109 |
| 109 return MOJO_RESULT_OK; | 110 return MOJO_RESULT_OK; |
| 110 } | 111 } |
| OLD | NEW |