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

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

Issue 556073003: [Ozone-DRI] Do proper bounds checks when moving the cursor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@restore-cursor
Patch Set: . Created 6 years, 3 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/ozone_platform_dri.h" 5 #include "ui/ozone/platform/dri/ozone_platform_dri.h"
6 6
7 #include "base/at_exit.h" 7 #include "base/at_exit.h"
8 #include "ui/base/cursor/ozone/bitmap_cursor_factory_ozone.h" 8 #include "ui/base/cursor/ozone/bitmap_cursor_factory_ozone.h"
9 #include "ui/events/ozone/device/device_manager.h" 9 #include "ui/events/ozone/device/device_manager.h"
10 #include "ui/events/ozone/evdev/cursor_delegate_evdev.h" 10 #include "ui/events/ozone/evdev/cursor_delegate_evdev.h"
11 #include "ui/events/ozone/evdev/event_factory_evdev.h" 11 #include "ui/events/ozone/evdev/event_factory_evdev.h"
12 #include "ui/ozone/platform/dri/dri_buffer.h" 12 #include "ui/ozone/platform/dri/dri_buffer.h"
13 #include "ui/ozone/platform/dri/dri_cursor.h" 13 #include "ui/ozone/platform/dri/dri_cursor.h"
14 #include "ui/ozone/platform/dri/dri_surface_factory.h" 14 #include "ui/ozone/platform/dri/dri_surface_factory.h"
15 #include "ui/ozone/platform/dri/dri_window.h" 15 #include "ui/ozone/platform/dri/dri_window.h"
16 #include "ui/ozone/platform/dri/dri_window_delegate_impl.h" 16 #include "ui/ozone/platform/dri/dri_window_delegate_impl.h"
17 #include "ui/ozone/platform/dri/dri_window_delegate_manager.h"
17 #include "ui/ozone/platform/dri/dri_window_manager.h" 18 #include "ui/ozone/platform/dri/dri_window_manager.h"
18 #include "ui/ozone/platform/dri/dri_wrapper.h" 19 #include "ui/ozone/platform/dri/dri_wrapper.h"
19 #include "ui/ozone/platform/dri/screen_manager.h" 20 #include "ui/ozone/platform/dri/screen_manager.h"
20 #include "ui/ozone/platform/dri/virtual_terminal_manager.h" 21 #include "ui/ozone/platform/dri/virtual_terminal_manager.h"
21 #include "ui/ozone/public/ozone_platform.h" 22 #include "ui/ozone/public/ozone_platform.h"
22 23
23 #if defined(OS_CHROMEOS) 24 #if defined(OS_CHROMEOS)
24 #include "ui/ozone/platform/dri/chromeos/native_display_delegate_dri.h" 25 #include "ui/ozone/platform/dri/chromeos/native_display_delegate_dri.h"
25 #endif 26 #endif
26 27
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 } 64 }
64 virtual scoped_ptr<PlatformWindow> CreatePlatformWindow( 65 virtual scoped_ptr<PlatformWindow> CreatePlatformWindow(
65 PlatformWindowDelegate* delegate, 66 PlatformWindowDelegate* delegate,
66 const gfx::Rect& bounds) OVERRIDE { 67 const gfx::Rect& bounds) OVERRIDE {
67 scoped_ptr<DriWindow> platform_window(new DriWindow( 68 scoped_ptr<DriWindow> platform_window(new DriWindow(
68 delegate, 69 delegate,
69 bounds, 70 bounds,
70 scoped_ptr<DriWindowDelegate>(new DriWindowDelegateImpl( 71 scoped_ptr<DriWindowDelegate>(new DriWindowDelegateImpl(
71 window_manager_.NextAcceleratedWidget(), screen_manager_.get())), 72 window_manager_.NextAcceleratedWidget(), screen_manager_.get())),
72 event_factory_ozone_.get(), 73 event_factory_ozone_.get(),
74 &window_delegate_manager_,
73 &window_manager_, 75 &window_manager_,
74 cursor_.get())); 76 cursor_.get()));
75 platform_window->Initialize(); 77 platform_window->Initialize();
76 return platform_window.PassAs<PlatformWindow>(); 78 return platform_window.PassAs<PlatformWindow>();
77 } 79 }
78 #if defined(OS_CHROMEOS) 80 #if defined(OS_CHROMEOS)
79 virtual scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() 81 virtual scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate()
80 OVERRIDE { 82 OVERRIDE {
81 return scoped_ptr<NativeDisplayDelegate>(new NativeDisplayDelegateDri( 83 return scoped_ptr<NativeDisplayDelegate>(new NativeDisplayDelegateDri(
82 dri_.get(), screen_manager_.get(), device_manager_.get())); 84 dri_.get(), screen_manager_.get(), device_manager_.get()));
83 } 85 }
84 #endif 86 #endif
85 virtual void InitializeUI() OVERRIDE { 87 virtual void InitializeUI() OVERRIDE {
86 dri_->Initialize(); 88 dri_->Initialize();
87 surface_factory_ozone_.reset(new DriSurfaceFactory( 89 surface_factory_ozone_.reset(new DriSurfaceFactory(
88 dri_.get(), screen_manager_.get(), &window_manager_)); 90 dri_.get(), screen_manager_.get(), &window_delegate_manager_));
89 cursor_factory_ozone_.reset(new BitmapCursorFactoryOzone); 91 cursor_factory_ozone_.reset(new BitmapCursorFactoryOzone);
90 cursor_.reset(new DriCursor(surface_factory_ozone_.get())); 92 cursor_.reset(
93 new DriCursor(surface_factory_ozone_.get(), &window_manager_));
91 event_factory_ozone_.reset( 94 event_factory_ozone_.reset(
92 new EventFactoryEvdev(cursor_.get(), device_manager_.get())); 95 new EventFactoryEvdev(cursor_.get(), device_manager_.get()));
93 if (surface_factory_ozone_->InitializeHardware() != 96 if (surface_factory_ozone_->InitializeHardware() !=
94 DriSurfaceFactory::INITIALIZED) 97 DriSurfaceFactory::INITIALIZED)
95 LOG(FATAL) << "failed to initialize display hardware"; 98 LOG(FATAL) << "failed to initialize display hardware";
96 99
97 } 100 }
98 101
99 virtual void InitializeGPU() OVERRIDE {} 102 virtual void InitializeGPU() OVERRIDE {}
100 103
101 private: 104 private:
102 scoped_ptr<VirtualTerminalManager> vt_manager_; 105 scoped_ptr<VirtualTerminalManager> vt_manager_;
103 scoped_ptr<DriWrapper> dri_; 106 scoped_ptr<DriWrapper> dri_;
104 scoped_ptr<DriBufferGenerator> buffer_generator_; 107 scoped_ptr<DriBufferGenerator> buffer_generator_;
105 scoped_ptr<ScreenManager> screen_manager_; 108 scoped_ptr<ScreenManager> screen_manager_;
106 scoped_ptr<DeviceManager> device_manager_; 109 scoped_ptr<DeviceManager> device_manager_;
107 110
108 scoped_ptr<DriSurfaceFactory> surface_factory_ozone_; 111 scoped_ptr<DriSurfaceFactory> surface_factory_ozone_;
109 scoped_ptr<BitmapCursorFactoryOzone> cursor_factory_ozone_; 112 scoped_ptr<BitmapCursorFactoryOzone> cursor_factory_ozone_;
110 scoped_ptr<DriCursor> cursor_; 113 scoped_ptr<DriCursor> cursor_;
111 scoped_ptr<EventFactoryEvdev> event_factory_ozone_; 114 scoped_ptr<EventFactoryEvdev> event_factory_ozone_;
112 115
113 DriWindowManager window_manager_; 116 DriWindowManager window_manager_;
117 DriWindowDelegateManager window_delegate_manager_;
114 118
115 DISALLOW_COPY_AND_ASSIGN(OzonePlatformDri); 119 DISALLOW_COPY_AND_ASSIGN(OzonePlatformDri);
116 }; 120 };
117 121
118 } // namespace 122 } // namespace
119 123
120 OzonePlatform* CreateOzonePlatformDri() { return new OzonePlatformDri; } 124 OzonePlatform* CreateOzonePlatformDri() { return new OzonePlatformDri; }
121 125
122 } // namespace ui 126 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/dri/gpu_platform_support_gbm.cc ('k') | ui/ozone/platform/dri/ozone_platform_gbm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698