| 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_window_delegate_impl.h" | 5 #include "ui/ozone/platform/dri/dri_window_delegate_impl.h" |
| 6 | 6 |
| 7 #include "base/trace_event/trace_event.h" | 7 #include "base/trace_event/trace_event.h" |
| 8 #include "third_party/skia/include/core/SkBitmap.h" | 8 #include "third_party/skia/include/core/SkBitmap.h" |
| 9 #include "third_party/skia/include/core/SkDevice.h" | 9 #include "third_party/skia/include/core/SkDevice.h" |
| 10 #include "third_party/skia/include/core/SkSurface.h" | 10 #include "third_party/skia/include/core/SkSurface.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 device_manager_->GetDrmDevice(gfx::kNullAcceleratedWidget); | 67 device_manager_->GetDrmDevice(gfx::kNullAcceleratedWidget); |
| 68 | 68 |
| 69 uint64_t cursor_width = 64; | 69 uint64_t cursor_width = 64; |
| 70 uint64_t cursor_height = 64; | 70 uint64_t cursor_height = 64; |
| 71 drm->GetCapability(DRM_CAP_CURSOR_WIDTH, &cursor_width); | 71 drm->GetCapability(DRM_CAP_CURSOR_WIDTH, &cursor_width); |
| 72 drm->GetCapability(DRM_CAP_CURSOR_HEIGHT, &cursor_height); | 72 drm->GetCapability(DRM_CAP_CURSOR_HEIGHT, &cursor_height); |
| 73 | 73 |
| 74 SkImageInfo info = SkImageInfo::MakeN32Premul(cursor_width, cursor_height); | 74 SkImageInfo info = SkImageInfo::MakeN32Premul(cursor_width, cursor_height); |
| 75 for (size_t i = 0; i < arraysize(cursor_buffers_); ++i) { | 75 for (size_t i = 0; i < arraysize(cursor_buffers_); ++i) { |
| 76 cursor_buffers_[i] = new DriBuffer(drm); | 76 cursor_buffers_[i] = new DriBuffer(drm); |
| 77 if (!cursor_buffers_[i]->Initialize(info)) { | 77 if (!cursor_buffers_[i]->Initialize(info, false)) { |
| 78 LOG(ERROR) << "Failed to initialize cursor buffer"; | 78 LOG(ERROR) << "Failed to initialize cursor buffer"; |
| 79 return; | 79 return; |
| 80 } | 80 } |
| 81 } | 81 } |
| 82 } | 82 } |
| 83 | 83 |
| 84 void DriWindowDelegateImpl::Shutdown() { | 84 void DriWindowDelegateImpl::Shutdown() { |
| 85 TRACE_EVENT1("dri", "DriWindowDelegateImpl::Shutdown", "widget", widget_); | 85 TRACE_EVENT1("dri", "DriWindowDelegateImpl::Shutdown", "widget", widget_); |
| 86 screen_manager_->RemoveObserver(this); | 86 screen_manager_->RemoveObserver(this); |
| 87 device_manager_->RemoveDrmDevice(widget_); | 87 device_manager_->RemoveDrmDevice(widget_); |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 | 192 |
| 193 void DriWindowDelegateImpl::UpdateWidgetToDrmDeviceMapping() { | 193 void DriWindowDelegateImpl::UpdateWidgetToDrmDeviceMapping() { |
| 194 scoped_refptr<DriWrapper> drm = nullptr; | 194 scoped_refptr<DriWrapper> drm = nullptr; |
| 195 if (controller_) | 195 if (controller_) |
| 196 drm = controller_->GetAllocationDriWrapper(); | 196 drm = controller_->GetAllocationDriWrapper(); |
| 197 | 197 |
| 198 device_manager_->UpdateDrmDevice(widget_, drm); | 198 device_manager_->UpdateDrmDevice(widget_, drm); |
| 199 } | 199 } |
| 200 | 200 |
| 201 } // namespace ui | 201 } // namespace ui |
| OLD | NEW |