| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "embedders/openglui/common/dart_host.h" | 5 #include "embedders/openglui/common/dart_host.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 #include <unistd.h> | 8 #include <unistd.h> |
| 9 | 9 |
| 10 #include "embedders/openglui/common/image_cache.h" |
| 10 #include "embedders/openglui/common/log.h" | 11 #include "embedders/openglui/common/log.h" |
| 11 | 12 |
| 12 DartHost::DartHost(Context *context) | 13 DartHost::DartHost(Context *context) |
| 13 : graphics_handler_(context->graphics_handler), | 14 : graphics_handler_(context->graphics_handler), |
| 14 input_handler_(context->input_handler), | 15 input_handler_(context->input_handler), |
| 15 sound_handler_(context->sound_handler), | 16 sound_handler_(context->sound_handler), |
| 16 timer_(context->timer), | 17 timer_(context->timer), |
| 17 vm_glue_(context->vm_glue), | 18 vm_glue_(context->vm_glue), |
| 18 has_context_(false), | 19 has_context_(false), |
| 19 started_(false), | 20 started_(false), |
| 20 active_(false) { | 21 active_(false) { |
| 22 ImageCache::Init(graphics_handler_->resource_path()); |
| 21 } | 23 } |
| 22 | 24 |
| 23 DartHost::~DartHost() { | 25 DartHost::~DartHost() { |
| 24 } | 26 } |
| 25 | 27 |
| 26 int32_t DartHost::OnStart() { | 28 int32_t DartHost::OnStart() { |
| 27 int result = vm_glue_->StartMainIsolate(); | 29 int result = vm_glue_->StartMainIsolate(); |
| 28 if (result != 0) { | 30 if (result != 0) { |
| 29 LOGE("startMainIsolate returned %d", result); | 31 LOGE("startMainIsolate returned %d", result); |
| 30 return -1; | 32 return -1; |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 } | 108 } |
| 107 | 109 |
| 108 void DartHost::OnConfigurationChanged() { | 110 void DartHost::OnConfigurationChanged() { |
| 109 LOGI("DartHost config changed"); | 111 LOGI("DartHost config changed"); |
| 110 } | 112 } |
| 111 | 113 |
| 112 void DartHost::OnLowMemory() { | 114 void DartHost::OnLowMemory() { |
| 113 LOGI("DartHost low on memory"); | 115 LOGI("DartHost low on memory"); |
| 114 } | 116 } |
| 115 | 117 |
| OLD | NEW |