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

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

Issue 399953003: ozone: Remove InitializeHardware / ShutdownHardware (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_surface_factory.h" 5 #include "ui/ozone/platform/dri/dri_surface_factory.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 8
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 screen_manager_(screen_manager), 121 screen_manager_(screen_manager),
122 state_(UNINITIALIZED), 122 state_(UNINITIALIZED),
123 allocated_widgets_(0) { 123 allocated_widgets_(0) {
124 } 124 }
125 125
126 DriSurfaceFactory::~DriSurfaceFactory() { 126 DriSurfaceFactory::~DriSurfaceFactory() {
127 if (state_ == INITIALIZED) 127 if (state_ == INITIALIZED)
128 ShutdownHardware(); 128 ShutdownHardware();
129 } 129 }
130 130
131 ui::SurfaceFactoryOzone::HardwareState DriSurfaceFactory::InitializeHardware() { 131 DriSurfaceFactory::HardwareState DriSurfaceFactory::InitializeHardware() {
132 if (state_ != UNINITIALIZED) 132 if (state_ != UNINITIALIZED)
133 return state_; 133 return state_;
134 134
135 if (drm_->get_fd() < 0) { 135 if (drm_->get_fd() < 0) {
136 LOG(ERROR) << "Failed to create DRI connection"; 136 LOG(ERROR) << "Failed to create DRI connection";
137 state_ = FAILED; 137 state_ = FAILED;
138 return state_; 138 return state_;
139 } 139 }
140 140
141 cursor_surface_.reset(CreateSurface(kCursorSize)); 141 cursor_surface_.reset(CreateSurface(kCursorSize));
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 controller->SetCursor(cursor_surface_.get()); 234 controller->SetCursor(cursor_surface_.get());
235 } 235 }
236 } else { 236 } else {
237 // No cursor set. 237 // No cursor set.
238 if (controller) 238 if (controller)
239 controller->UnsetCursor(); 239 controller->UnsetCursor();
240 } 240 }
241 } 241 }
242 242
243 } // namespace ui 243 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698