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

Unified Diff: samples/android_sample/jni/graphics.cc

Issue 11416343: Refactored Android samples / embedder. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix type error on playBackground Created 8 years 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 | « samples/android_sample/jni/graphics.h ('k') | samples/android_sample/jni/input_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samples/android_sample/jni/graphics.cc
diff --git a/samples/android_sample/jni/graphics.cc b/samples/android_sample/jni/graphics.cc
index f850226775885a6cd6502102e1f8e86f177c883d..ac0646e5e50a34b04e06650727853f95a1f300f7 100644
--- a/samples/android_sample/jni/graphics.cc
+++ b/samples/android_sample/jni/graphics.cc
@@ -1,7 +1,14 @@
+// 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 "jni/graphics.h"
+
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
+#include "jni/log.h"
+
Graphics::Graphics(android_app* application, Timer* timer)
: application_(application),
timer_(timer),
@@ -34,19 +41,19 @@ int32_t Graphics::Start() {
display_ = eglGetDisplay(EGL_DEFAULT_DISPLAY);
if (display_ != EGL_NO_DISPLAY) {
- Log::Print("eglInitialize");
+ LOGI("eglInitialize");
if (eglInitialize(display_, NULL, NULL)) {
- Log::Print("eglChooseConfig");
+ LOGI("eglChooseConfig");
if (eglChooseConfig(display_, attributes, &config, 1, &numConfigs) &&
numConfigs > 0) {
- Log::Print("eglGetConfigAttrib");
+ LOGI("eglGetConfigAttrib");
if (eglGetConfigAttrib(display_, config,
EGL_NATIVE_VISUAL_ID, &format)) {
ANativeWindow_setBuffersGeometry(application_->window, 0, 0, format);
surface_ = eglCreateWindowSurface(display_, config,
(EGLNativeWindowType)application_->window, NULL);
if (surface_ != EGL_NO_SURFACE) {
- Log::Print("eglCreateContext");
+ LOGI("eglCreateContext");
context_ = eglCreateContext(display_, config, EGL_NO_CONTEXT,
ctx_attribs);
if (context_ != EGL_NO_CONTEXT) {
@@ -64,13 +71,13 @@ int32_t Graphics::Start() {
}
}
}
- Log::PrintErr("Error starting graphics");
+ LOGE("Error starting graphics");
Stop();
return -1;
}
void Graphics::Stop() {
- Log::Print("Stopping graphics");
+ LOGI("Stopping graphics");
if (display_ != EGL_NO_DISPLAY) {
eglMakeCurrent(display_, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
if (context_ != EGL_NO_CONTEXT) {
@@ -89,4 +96,3 @@ void Graphics::Stop() {
int32_t Graphics::Update() {
return 0;
}
-
« no previous file with comments | « samples/android_sample/jni/graphics.h ('k') | samples/android_sample/jni/input_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698