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

Side by Side Diff: views/widget/native_widget_wayland.cc

Issue 8240006: Use a mocked compositor for unit tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge Created 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 allocation_.set_width(std::max(params.bounds.width(), 1)); 76 allocation_.set_width(std::max(params.bounds.width(), 1));
77 allocation_.set_height(std::max(params.bounds.height(), 1)); 77 allocation_.set_height(std::max(params.bounds.height(), 1));
78 78
79 egl_window_ = wl_egl_window_create(wayland_window_->surface(), 79 egl_window_ = wl_egl_window_create(wayland_window_->surface(),
80 allocation_.width(), 80 allocation_.width(),
81 allocation_.height()); 81 allocation_.height());
82 82
83 SetNativeWindowProperty(kNativeWidgetKey, this); 83 SetNativeWindowProperty(kNativeWidgetKey, this);
84 84
85 if (View::get_use_acceleration_when_possible()) { 85 if (View::get_use_acceleration_when_possible()) {
86 if (Widget::compositor_factory()) { 86 if (ui::Compositor::compositor_factory()) {
87 compositor_ = (*Widget::compositor_factory())(); 87 compositor_ = (*ui::Compositor::compositor_factory())(this);
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( 97 context_ = gfx::GLContext::CreateGLContext(
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after
678 678
679 // static 679 // static
680 bool NativeWidgetPrivate::IsMouseButtonDown() { 680 bool NativeWidgetPrivate::IsMouseButtonDown() {
681 NOTIMPLEMENTED(); 681 NOTIMPLEMENTED();
682 return false; 682 return false;
683 } 683 }
684 684
685 } // namespace internal 685 } // namespace internal
686 686
687 } // namespace views 687 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698