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

Unified 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: fix TODO 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 side-by-side diff with in-line comments
Download patch
Index: mojo/examples/sample_app/gles2_client_impl.h
diff --git a/mojo/examples/sample_app/gles2_client_impl.h b/mojo/examples/sample_app/gles2_client_impl.h
index d927c24a5b478e2372d981d6b76a149d393f8b43..03c2a3f28411e81a48bf8453c7667ff6a7c8a96a 100644
--- a/mojo/examples/sample_app/gles2_client_impl.h
+++ b/mojo/examples/sample_app/gles2_client_impl.h
@@ -10,6 +10,7 @@
#include "mojo/public/gles2/gles2.h"
#include "mojom/native_viewport.h"
#include "ui/gfx/point_f.h"
+#include "ui/gfx/size.h"
namespace mojo {
namespace examples {
@@ -19,14 +20,12 @@ class GLES2ClientImpl {
explicit GLES2ClientImpl(ScopedMessagePipeHandle pipe);
virtual ~GLES2ClientImpl();
+ void SetSize(gfx::Size size);
void HandleInputEvent(const Event& event);
private:
- void DidCreateContext(uint32_t width, uint32_t height);
- static void DidCreateContextThunk(
- void* closure,
- uint32_t width,
- uint32_t height);
+ void DidCreateContext();
+ static void DidCreateContextThunk(void* closure);
void ContextLost();
static void ContextLostThunk(void* closure);
void DrawAnimationFrame();
@@ -35,7 +34,10 @@ class GLES2ClientImpl {
void RequestAnimationFrames();
void CancelAnimationFrames();
+ void MaybeInitializeCube();
+
MojoTimeTicks last_time_;
+ gfx::Size size_;
SpinningCube cube_;
gfx::PointF capture_point_;
gfx::PointF last_drag_point_;
@@ -43,6 +45,7 @@ class GLES2ClientImpl {
bool getting_animation_frames_;
MojoGLES2Context context_;
+ bool context_created_;
MOJO_DISALLOW_COPY_AND_ASSIGN(GLES2ClientImpl);
};

Powered by Google App Engine
This is Rietveld 408576698