| Index: mojo/services/native_viewport/native_viewport_win.cc
|
| diff --git a/mojo/services/native_viewport/native_viewport_win.cc b/mojo/services/native_viewport/native_viewport_win.cc
|
| index 3654cb7d24a2cded07a08809c3394eda4a748e28..3c3ae74099eba0947d55997476f504066107835e 100644
|
| --- a/mojo/services/native_viewport/native_viewport_win.cc
|
| +++ b/mojo/services/native_viewport/native_viewport_win.cc
|
| @@ -4,9 +4,6 @@
|
|
|
| #include "mojo/services/native_viewport/native_viewport.h"
|
|
|
| -#include "base/bind.h"
|
| -#include "gpu/command_buffer/client/gl_in_process_context.h"
|
| -#include "gpu/command_buffer/client/gles2_implementation.h"
|
| #include "ui/events/event.h"
|
| #include "ui/gfx/win/window_impl.h"
|
|
|
| @@ -17,7 +14,7 @@ class NativeViewportWin : public gfx::WindowImpl,
|
| public NativeViewport {
|
| public:
|
| explicit NativeViewportWin(NativeViewportDelegate* delegate)
|
| - : delegate_(delegate) {
|
| + : NativeViewport(delegate) {
|
| Init(NULL, gfx::Rect(10, 10, 500, 500));
|
| ShowWindow(hwnd(), SW_SHOWNORMAL);
|
| SetWindowText(hwnd(), L"native_viewport::NativeViewportWin!");
|
| @@ -53,14 +50,9 @@ class NativeViewportWin : public gfx::WindowImpl,
|
| LRESULT OnCreate(CREATESTRUCT* create_struct) {
|
| RECT cr;
|
| GetClientRect(hwnd(), &cr);
|
| - gpu::GLInProcessContextAttribs attribs;
|
| - gl_context_.reset(gpu::GLInProcessContext::CreateContext(
|
| - false, hwnd(), gfx::Size(cr.right - cr.left, cr.bottom - cr.top),
|
| - false, attribs, gfx::PreferDiscreteGpu));
|
| - gl_context_->SetContextLostCallback(base::Bind(
|
| - &NativeViewportWin::OnGLContextLost, base::Unretained(this)));
|
| -
|
| - delegate_->OnGLContextAvailable(gl_context_->GetImplementation());
|
| + bounds_ = gfx::Rect(cr);
|
| + widget_ = hwnd();
|
| + OnAcceleratedWidgetAvailable();
|
| return 0;
|
| }
|
| void OnPaint(HDC) {
|
| @@ -83,14 +75,6 @@ class NativeViewportWin : public gfx::WindowImpl,
|
| delegate_->OnDestroyed();
|
| }
|
|
|
| - void OnGLContextLost() {
|
| - gl_context_.reset();
|
| - delegate_->OnGLContextLost();
|
| - }
|
| -
|
| - NativeViewportDelegate* delegate_;
|
| - scoped_ptr<gpu::GLInProcessContext> gl_context_;
|
| -
|
| DISALLOW_COPY_AND_ASSIGN(NativeViewportWin);
|
| };
|
|
|
|
|