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

Side by Side Diff: ui/ozone/platform/dri/dri_window.cc

Issue 406093002: ozone: Remove GetAcceleratedWidget from SurfaceFactoryOzone (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 months 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "ui/ozone/platform/dri/dri_window.h" 5 #include "ui/ozone/platform/dri/dri_window.h"
6 6
7 #include "ui/events/event.h" 7 #include "ui/events/event.h"
8 #include "ui/events/platform/platform_event_source.h" 8 #include "ui/events/platform/platform_event_source.h"
9 #include "ui/ozone/platform/dri/dri_surface_factory.h"
9 #include "ui/ozone/public/cursor_factory_ozone.h" 10 #include "ui/ozone/public/cursor_factory_ozone.h"
10 #include "ui/ozone/public/surface_factory_ozone.h" 11 #include "ui/ozone/public/surface_factory_ozone.h"
11 #include "ui/platform_window/platform_window_delegate.h" 12 #include "ui/platform_window/platform_window_delegate.h"
12 13
13 namespace ui { 14 namespace ui {
14 15
15 DriWindow::DriWindow(PlatformWindowDelegate* delegate, 16 DriWindow::DriWindow(PlatformWindowDelegate* delegate,
16 const gfx::Rect& bounds) 17 const gfx::Rect& bounds,
18 DriSurfaceFactory* surface_factory)
17 : delegate_(delegate), bounds_(bounds) { 19 : delegate_(delegate), bounds_(bounds) {
18 widget_ = SurfaceFactoryOzone::GetInstance()->GetAcceleratedWidget(); 20 widget_ = surface_factory->GetAcceleratedWidget();
19 delegate_->OnAcceleratedWidgetAvailable(widget_); 21 delegate_->OnAcceleratedWidgetAvailable(widget_);
20 PlatformEventSource::GetInstance()->AddPlatformEventDispatcher(this); 22 PlatformEventSource::GetInstance()->AddPlatformEventDispatcher(this);
21 } 23 }
22 24
23 DriWindow::~DriWindow() { 25 DriWindow::~DriWindow() {
24 PlatformEventSource::GetInstance()->RemovePlatformEventDispatcher(this); 26 PlatformEventSource::GetInstance()->RemovePlatformEventDispatcher(this);
25 } 27 }
26 28
27 void DriWindow::Show() {} 29 void DriWindow::Show() {}
28 30
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 return true; 62 return true;
61 } 63 }
62 64
63 uint32_t DriWindow::DispatchEvent(const PlatformEvent& ne) { 65 uint32_t DriWindow::DispatchEvent(const PlatformEvent& ne) {
64 Event* event = static_cast<Event*>(ne); 66 Event* event = static_cast<Event*>(ne);
65 delegate_->DispatchEvent(event); 67 delegate_->DispatchEvent(event);
66 return POST_DISPATCH_STOP_PROPAGATION; 68 return POST_DISPATCH_STOP_PROPAGATION;
67 } 69 }
68 70
69 } // namespace ui 71 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698