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

Unified Diff: mojo/services/native_viewport/native_viewport_android.cc

Issue 59383011: Factor common code into native_viewport_controller.cc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix windows build Created 7 years, 1 month 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/services/native_viewport/native_viewport_android.cc
diff --git a/mojo/services/native_viewport/native_viewport_android.cc b/mojo/services/native_viewport/native_viewport_android.cc
index 753b8ed7d4f4046749f8db63abfbeac8de67ba36..fbb02f5f008f2d23087668df619f794c84f41f95 100644
--- a/mojo/services/native_viewport/native_viewport_android.cc
+++ b/mojo/services/native_viewport/native_viewport_android.cc
@@ -5,8 +5,6 @@
#include "mojo/services/native_viewport/native_viewport_android.h"
#include <android/native_window_jni.h>
-#include "gpu/command_buffer/client/gl_in_process_context.h"
-#include "gpu/command_buffer/client/gles2_implementation.h"
#include "mojo/services/native_viewport/android/mojo_viewport.h"
#include "mojo/shell/context.h"
@@ -27,19 +25,7 @@ NativeViewportAndroid::~NativeViewportAndroid() {
void NativeViewportAndroid::OnNativeWindowCreated(ANativeWindow* window) {
DCHECK(!window_);
window_ = window;
-
- gpu::GLInProcessContextAttribs attribs;
- gl_context_.reset(gpu::GLInProcessContext::CreateContext(
- false, window_, size_, false, attribs, gfx::PreferDiscreteGpu));
- gl_context_->SetContextLostCallback(base::Bind(
- &NativeViewportAndroid::OnGLContextLost, base::Unretained(this)));
-
- delegate_->OnGLContextAvailable(gl_context_->GetImplementation());
-}
-
-void NativeViewportAndroid::OnGLContextLost() {
- gl_context_.reset();
- delegate_->OnGLContextLost();
+ delegate_->OnAcceleratedWidgetAvailable(window_);
}
void NativeViewportAndroid::OnNativeWindowDestroyed() {
@@ -53,11 +39,14 @@ void NativeViewportAndroid::OnResized(const gfx::Size& size) {
}
void NativeViewportAndroid::ReleaseWindow() {
- gl_context_.reset();
ANativeWindow_release(window_);
window_ = NULL;
}
+gfx::Size NativeViewportAndroid::GetSize() {
+ return size_;
+}
+
void NativeViewportAndroid::Close() {
// TODO(beng): close activity containing MojoView?
« no previous file with comments | « mojo/services/native_viewport/native_viewport_android.h ('k') | mojo/services/native_viewport/native_viewport_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698