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

Unified Diff: runtime/embedders/openglui/common/vm_glue.cc

Issue 13042015: Various OpenGLUI changes: (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 9 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: runtime/embedders/openglui/common/vm_glue.cc
===================================================================
--- runtime/embedders/openglui/common/vm_glue.cc (revision 20570)
+++ runtime/embedders/openglui/common/vm_glue.cc (working copy)
@@ -27,7 +27,11 @@
const char* main_script)
: surface_(surface),
isolate_(NULL),
- initialized_script_(false) {
+ initialized_script_(false),
+ x_(0.0),
+ y_(0.0),
+ z_(0.0),
+ accelerometer_changed_(false) {
LOGI("Creating VMGlue");
if (main_script == NULL) {
main_script = "main.dart";
@@ -235,11 +239,25 @@
int VMGlue::CallUpdate() {
if (initialized_script_) {
+ // If the accelerometer has changed, first do that
+ // event.
Dart_EnterIsolate(isolate_);
+ if (accelerometer_changed_) {
+ Dart_Handle args[3];
+ LOGI("Invoking onAccelerometer(%f,%f,%f)", x_, y_, z_);
+ Dart_EnterScope();
+ args[0] = CheckError(Dart_NewDouble(x_));
+ args[1] = CheckError(Dart_NewDouble(y_));
+ args[2] = CheckError(Dart_NewDouble(z_));
+ Invoke("onAccelerometer", 3, args, false);
+ Dart_ExitScope();
+ accelerometer_changed_ = false;
+ }
Dart_EnterScope();
int rtn = Invoke("update_", 0, 0);
Dart_ExitScope();
Dart_ExitIsolate();
+ LOGI("Invoke update_ returns %d", rtn);
return rtn;
}
return -1;
@@ -280,7 +298,7 @@
bool isAltKeyDown, bool isCtrlKeyDown,
bool isShiftKeyDown, int32_t repeat) {
if (initialized_script_) {
- LOGI("Invoking %s", function);
+ LOGI("Invoking %s(_,%d,...)", function, key_code);
Dart_EnterIsolate(isolate_);
Dart_EnterScope();
Dart_Handle args[6];

Powered by Google App Engine
This is Rietveld 408576698