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

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

Issue 25081002: Remove openglui embedder code (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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
« no previous file with comments | « runtime/embedders/openglui/common/dart_host.h ('k') | runtime/embedders/openglui/common/events.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/embedders/openglui/common/dart_host.cc
diff --git a/runtime/embedders/openglui/common/dart_host.cc b/runtime/embedders/openglui/common/dart_host.cc
deleted file mode 100644
index dd2c1cd7fe410963bff0cf016e1dadbfc366bdc1..0000000000000000000000000000000000000000
--- a/runtime/embedders/openglui/common/dart_host.cc
+++ /dev/null
@@ -1,117 +0,0 @@
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-#include "embedders/openglui/common/dart_host.h"
-
-#include <math.h>
-#include <unistd.h>
-
-#include "embedders/openglui/common/image_cache.h"
-#include "embedders/openglui/common/log.h"
-
-DartHost::DartHost(Context *context)
- : graphics_handler_(context->graphics_handler),
- input_handler_(context->input_handler),
- sound_handler_(context->sound_handler),
- timer_(context->timer),
- vm_glue_(context->vm_glue),
- has_context_(false),
- started_(false),
- active_(false) {
- ImageCache::Init(graphics_handler_->resource_path());
-}
-
-DartHost::~DartHost() {
-}
-
-int32_t DartHost::OnStart() {
- int result = vm_glue_->StartMainIsolate();
- if (result != 0) {
- LOGE("startMainIsolate returned %d", result);
- return -1;
- }
- started_ = true;
- return 0;
-}
-
-int32_t DartHost::Activate() {
- if (!has_context_) {
- if (graphics_handler_->Start() != 0) {
- return -1;
- }
- if (sound_handler_->Start() != 0) {
- graphics_handler_->Stop();
- return -1;
- }
- if (input_handler_->Start() != 0) {
- sound_handler_->Stop();
- graphics_handler_->Stop();
- return -1;
- }
- int32_t rtn = vm_glue_->CallSetup(true);
- timer_->Reset();
- has_context_ = true;
- return rtn;
- }
- return 0;
-}
-
-void DartHost::Deactivate() {
- Pause();
- if (has_context_) {
- vm_glue_->CallShutdown();
- input_handler_->Stop();
- sound_handler_->Stop();
- graphics_handler_->Stop();
- has_context_ = false;
- }
-}
-
-int32_t DartHost::OnStep() {
- if (active_) {
- timer_->Update();
- if (vm_glue_->CallUpdate() != 0 ||
- graphics_handler_->Update() != 0) {
- return -1;
- }
- }
- return 0;
-}
-
-int32_t DartHost::Resume() {
- if (!active_) {
- if (Activate() == 0) {
- sound_handler_->Resume();
- active_ = true;
- }
- }
- return 0;
-}
-
-void DartHost::Pause() {
- if (active_) {
- active_ = false; // This stops update() calls.
- sound_handler_->Suspend();
- }
-}
-
-void DartHost::FreeAllResources() {
- if (started_) {
- vm_glue_->FinishMainIsolate();
- started_ = false;
- }
-}
-
-void DartHost::OnSaveState(void** data, size_t* size) {
- LOGI("Saving DartHost state");
-}
-
-void DartHost::OnConfigurationChanged() {
- LOGI("DartHost config changed");
-}
-
-void DartHost::OnLowMemory() {
- LOGI("DartHost low on memory");
-}
-
« no previous file with comments | « runtime/embedders/openglui/common/dart_host.h ('k') | runtime/embedders/openglui/common/events.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698