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

Unified Diff: mojo/services/native_viewport/native_viewport_x11.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
« no previous file with comments | « mojo/services/native_viewport/native_viewport_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/native_viewport/native_viewport_x11.cc
diff --git a/mojo/services/native_viewport/native_viewport_x11.cc b/mojo/services/native_viewport/native_viewport_x11.cc
index e0c23ce1202926d361a96ba7dd6b25419da350d9..e2310cbbd785e1b27c3c28a6c17d52f9ffd624f7 100644
--- a/mojo/services/native_viewport/native_viewport_x11.cc
+++ b/mojo/services/native_viewport/native_viewport_x11.cc
@@ -6,12 +6,8 @@
#include <X11/Xlib.h>
-#include "base/bind.h"
-#include "base/logging.h"
#include "base/message_loop/message_loop.h"
#include "base/message_loop/message_pump_x11.h"
-#include "gpu/command_buffer/client/gl_in_process_context.h"
-#include "gpu/command_buffer/client/gles2_implementation.h"
#include "ui/gfx/rect.h"
#include "ui/gfx/x/x11_types.h"
@@ -44,14 +40,7 @@ class NativeViewportX11 : public NativeViewport,
XMapWindow(display, window_);
XFlush(display);
- gpu::GLInProcessContextAttribs attribs;
- gl_context_.reset(gpu::GLInProcessContext::CreateContext(
- false, window_, bounds_.size(), false,
- attribs, gfx::PreferDiscreteGpu));
- gl_context_->SetContextLostCallback(base::Bind(
- &NativeViewportX11::OnGLContextLost, base::Unretained(this)));
-
- delegate_->OnGLContextAvailable(gl_context_->GetImplementation());
+ delegate_->OnAcceleratedWidgetAvailable(window_);
}
virtual ~NativeViewportX11() {
@@ -63,6 +52,9 @@ class NativeViewportX11 : public NativeViewport,
private:
// Overridden from NativeViewport:
+ virtual gfx::Size GetSize() OVERRIDE {
+ return bounds_.size();
+ }
virtual void Close() OVERRIDE {
// TODO(beng): perform this in response to XWindow destruction.
delegate_->OnDestroyed();
@@ -73,15 +65,9 @@ class NativeViewportX11 : public NativeViewport,
return true;
}
- void OnGLContextLost() {
- gl_context_.reset();
- delegate_->OnGLContextLost();
- }
-
NativeViewportDelegate* delegate_;
gfx::Rect bounds_;
XID window_;
- scoped_ptr<gpu::GLInProcessContext> gl_context_;
DISALLOW_COPY_AND_ASSIGN(NativeViewportX11);
};
« no previous file with comments | « mojo/services/native_viewport/native_viewport_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698