Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(437)

Side by Side Diff: mojo/examples/sample_app/sample_app.cc

Issue 131153007: Send size to NativeViewportClient::OnCreated instead of GLES2Client::DidCreateContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase, fix various issues Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « mojo/examples/sample_app/gles2_client_impl.cc ('k') | mojo/gles2/gles2_client_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « mojo/examples/sample_app/gles2_client_impl.cc ('k') | mojo/gles2/gles2_client_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698