| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "views/widget/native_widget_wayland.h" | 5 #include "views/widget/native_widget_wayland.h" |
| 6 | 6 |
| 7 #include <cairo.h> | 7 #include <cairo.h> |
| 8 #include <cairo-gl.h> | 8 #include <cairo-gl.h> |
| 9 #include <EGL/egl.h> | 9 #include <EGL/egl.h> |
| 10 #include <GL/gl.h> | 10 #include <GL/gl.h> |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 compositor_ = (*Widget::compositor_factory())(); | 87 compositor_ = (*Widget::compositor_factory())(); |
| 88 } else { | 88 } else { |
| 89 compositor_ = ui::Compositor::Create(this, | 89 compositor_ = ui::Compositor::Create(this, |
| 90 egl_window_, | 90 egl_window_, |
| 91 allocation_.size()); | 91 allocation_.size()); |
| 92 } | 92 } |
| 93 if (compositor_.get()) | 93 if (compositor_.get()) |
| 94 delegate_->AsWidget()->GetRootView()->SetPaintToLayer(true); | 94 delegate_->AsWidget()->GetRootView()->SetPaintToLayer(true); |
| 95 } else { | 95 } else { |
| 96 surface_ = gfx::GLSurface::CreateViewGLSurface(false, egl_window_); | 96 surface_ = gfx::GLSurface::CreateViewGLSurface(false, egl_window_); |
| 97 context_ = gfx::GLContext::CreateGLContext(NULL, surface_.get()); | 97 context_ = gfx::GLContext::CreateGLContext( |
| 98 NULL, |
| 99 surface_.get(), |
| 100 gfx::PreferIntegratedGpu); |
| 98 | 101 |
| 99 if (!context_->MakeCurrent(surface_.get())) | 102 if (!context_->MakeCurrent(surface_.get())) |
| 100 DLOG(ERROR) << "Failed to make surface current"; | 103 DLOG(ERROR) << "Failed to make surface current"; |
| 101 | 104 |
| 102 device_ = cairo_egl_device_create(gfx::GLSurfaceEGL::GetHardwareDisplay(), | 105 device_ = cairo_egl_device_create(gfx::GLSurfaceEGL::GetHardwareDisplay(), |
| 103 context_->GetHandle()); | 106 context_->GetHandle()); |
| 104 if (cairo_device_status(device_) != CAIRO_STATUS_SUCCESS) | 107 if (cairo_device_status(device_) != CAIRO_STATUS_SUCCESS) |
| 105 DLOG(ERROR) << "Failed to create cairo egl device"; | 108 DLOG(ERROR) << "Failed to create cairo egl device"; |
| 106 | 109 |
| 107 cairo_surface_ = cairo_gl_surface_create_for_egl(device_, | 110 cairo_surface_ = cairo_gl_surface_create_for_egl(device_, |
| (...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 675 | 678 |
| 676 // static | 679 // static |
| 677 bool NativeWidgetPrivate::IsMouseButtonDown() { | 680 bool NativeWidgetPrivate::IsMouseButtonDown() { |
| 678 NOTIMPLEMENTED(); | 681 NOTIMPLEMENTED(); |
| 679 return false; | 682 return false; |
| 680 } | 683 } |
| 681 | 684 |
| 682 } // namespace internal | 685 } // namespace internal |
| 683 | 686 |
| 684 } // namespace views | 687 } // namespace views |
| OLD | NEW |