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

Side by Side Diff: mojo/examples/sample_app/gles2_client_impl.h

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, 10 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/launcher/launcher.cc ('k') | mojo/examples/sample_app/gles2_client_impl.cc » ('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 #ifndef MOJO_EXAMPLES_SAMPLE_APP_GLES2_CLIENT_IMPL_H_ 5 #ifndef MOJO_EXAMPLES_SAMPLE_APP_GLES2_CLIENT_IMPL_H_
6 #define MOJO_EXAMPLES_SAMPLE_APP_GLES2_CLIENT_IMPL_H_ 6 #define MOJO_EXAMPLES_SAMPLE_APP_GLES2_CLIENT_IMPL_H_
7 7
8 #include "mojo/examples/sample_app/spinning_cube.h" 8 #include "mojo/examples/sample_app/spinning_cube.h"
9 #include "mojo/public/bindings/lib/remote_ptr.h" 9 #include "mojo/public/bindings/lib/remote_ptr.h"
10 #include "mojo/public/gles2/gles2.h" 10 #include "mojo/public/gles2/gles2.h"
11 #include "mojom/native_viewport.h" 11 #include "mojom/native_viewport.h"
12 #include "ui/gfx/point_f.h" 12 #include "ui/gfx/point_f.h"
13 #include "ui/gfx/size.h"
13 14
14 namespace mojo { 15 namespace mojo {
15 namespace examples { 16 namespace examples {
16 17
17 class GLES2ClientImpl { 18 class GLES2ClientImpl {
18 public: 19 public:
19 explicit GLES2ClientImpl(ScopedMessagePipeHandle pipe); 20 explicit GLES2ClientImpl(ScopedMessagePipeHandle pipe);
20 virtual ~GLES2ClientImpl(); 21 virtual ~GLES2ClientImpl();
21 22
23 void SetSize(const Size& size);
22 void HandleInputEvent(const Event& event); 24 void HandleInputEvent(const Event& event);
23 25
24 private: 26 private:
25 void DidCreateContext(uint32_t width, uint32_t height); 27 void DidCreateContext();
26 static void DidCreateContextThunk( 28 static void DidCreateContextThunk(void* closure);
27 void* closure,
28 uint32_t width,
29 uint32_t height);
30 void ContextLost(); 29 void ContextLost();
31 static void ContextLostThunk(void* closure); 30 static void ContextLostThunk(void* closure);
32 void DrawAnimationFrame(); 31 void DrawAnimationFrame();
33 static void DrawAnimationFrameThunk(void* closure); 32 static void DrawAnimationFrameThunk(void* closure);
34 33
35 void RequestAnimationFrames(); 34 void RequestAnimationFrames();
36 void CancelAnimationFrames(); 35 void CancelAnimationFrames();
37 36
37 void InitializeCubeIfNeeded();
38
38 MojoTimeTicks last_time_; 39 MojoTimeTicks last_time_;
40 gfx::Size size_;
39 SpinningCube cube_; 41 SpinningCube cube_;
40 gfx::PointF capture_point_; 42 gfx::PointF capture_point_;
41 gfx::PointF last_drag_point_; 43 gfx::PointF last_drag_point_;
42 MojoTimeTicks drag_start_time_; 44 MojoTimeTicks drag_start_time_;
43 bool getting_animation_frames_; 45 bool getting_animation_frames_;
44 46
45 MojoGLES2Context context_; 47 MojoGLES2Context context_;
48 bool context_created_;
46 49
47 MOJO_DISALLOW_COPY_AND_ASSIGN(GLES2ClientImpl); 50 MOJO_DISALLOW_COPY_AND_ASSIGN(GLES2ClientImpl);
48 }; 51 };
49 52
50 } // namespace examples 53 } // namespace examples
51 } // namespace mojo 54 } // namespace mojo
52 55
53 #endif // MOJO_EXAMPLES_SAMPLE_APP_GLES2_CLIENT_IMPL_H_ 56 #endif // MOJO_EXAMPLES_SAMPLE_APP_GLES2_CLIENT_IMPL_H_
OLDNEW
« no previous file with comments | « mojo/examples/launcher/launcher.cc ('k') | mojo/examples/sample_app/gles2_client_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698