OLD | NEW |
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 "third_party/skia/include/core/SkBitmap.h" | 10 #include "third_party/skia/include/core/SkBitmap.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 state_(UNINITIALIZED), | 54 state_(UNINITIALIZED), |
55 allocated_widgets_(0), | 55 allocated_widgets_(0), |
56 cursor_frontbuffer_(0) { | 56 cursor_frontbuffer_(0) { |
57 } | 57 } |
58 | 58 |
59 DriSurfaceFactory::~DriSurfaceFactory() { | 59 DriSurfaceFactory::~DriSurfaceFactory() { |
60 if (state_ == INITIALIZED) | 60 if (state_ == INITIALIZED) |
61 ShutdownHardware(); | 61 ShutdownHardware(); |
62 } | 62 } |
63 | 63 |
64 ui::SurfaceFactoryOzone::HardwareState DriSurfaceFactory::InitializeHardware() { | 64 DriSurfaceFactory::HardwareState DriSurfaceFactory::InitializeHardware() { |
65 if (state_ != UNINITIALIZED) | 65 if (state_ != UNINITIALIZED) |
66 return state_; | 66 return state_; |
67 | 67 |
68 if (drm_->get_fd() < 0) { | 68 if (drm_->get_fd() < 0) { |
69 LOG(ERROR) << "Failed to create DRI connection"; | 69 LOG(ERROR) << "Failed to create DRI connection"; |
70 state_ = FAILED; | 70 state_ = FAILED; |
71 return state_; | 71 return state_; |
72 } | 72 } |
73 | 73 |
74 SkImageInfo info = SkImageInfo::MakeN32Premul(kCursorSize.width(), | 74 SkImageInfo info = SkImageInfo::MakeN32Premul(kCursorSize.width(), |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 cursor_frontbuffer_ ^= 1; | 169 cursor_frontbuffer_ ^= 1; |
170 } | 170 } |
171 } else { | 171 } else { |
172 // No cursor set. | 172 // No cursor set. |
173 if (controller) | 173 if (controller) |
174 controller->UnsetCursor(); | 174 controller->UnsetCursor(); |
175 } | 175 } |
176 } | 176 } |
177 | 177 |
178 } // namespace ui | 178 } // namespace ui |
OLD | NEW |