| 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/drm/gpu/screen_manager.h" | 5 #include "ui/ozone/platform/drm/gpu/screen_manager.h" |
| 6 | 6 |
| 7 #include <xf86drmMode.h> | 7 #include <xf86drmMode.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 } | 53 } |
| 54 | 54 |
| 55 // Don't copy anything if the sizes mismatch. This can happen when the user | 55 // Don't copy anything if the sizes mismatch. This can happen when the user |
| 56 // changes modes. | 56 // changes modes. |
| 57 if (saved_buffer.canvas()->getBaseLayerSize() != | 57 if (saved_buffer.canvas()->getBaseLayerSize() != |
| 58 modeset_buffer.canvas()->getBaseLayerSize()) { | 58 modeset_buffer.canvas()->getBaseLayerSize()) { |
| 59 VLOG(2) << "Previous buffer has a different size than modeset buffer"; | 59 VLOG(2) << "Previous buffer has a different size than modeset buffer"; |
| 60 return; | 60 return; |
| 61 } | 61 } |
| 62 | 62 |
| 63 skia::RefPtr<SkImage> image = saved_buffer.image(); | |
| 64 SkPaint paint; | 63 SkPaint paint; |
| 65 // Copy the source buffer. Do not perform any blending. | 64 // Copy the source buffer. Do not perform any blending. |
| 66 paint.setXfermodeMode(SkXfermode::kSrc_Mode); | 65 paint.setXfermodeMode(SkXfermode::kSrc_Mode); |
| 67 modeset_buffer.canvas()->drawImage(image.get(), 0, 0, &paint); | 66 modeset_buffer.canvas()->drawImage(saved_buffer.image(), 0, 0, &paint); |
| 68 } | 67 } |
| 69 | 68 |
| 70 CrtcController* GetCrtcController(HardwareDisplayController* controller, | 69 CrtcController* GetCrtcController(HardwareDisplayController* controller, |
| 71 const scoped_refptr<DrmDevice>& drm, | 70 const scoped_refptr<DrmDevice>& drm, |
| 72 uint32_t crtc) { | 71 uint32_t crtc) { |
| 73 for (const auto& crtc_controller : controller->crtc_controllers()) { | 72 for (const auto& crtc_controller : controller->crtc_controllers()) { |
| 74 if (crtc_controller->crtc() == crtc) | 73 if (crtc_controller->crtc() == crtc) |
| 75 return crtc_controller.get(); | 74 return crtc_controller.get(); |
| 76 } | 75 } |
| 77 | 76 |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 DrmWindow* ScreenManager::FindWindowAt(const gfx::Rect& bounds) const { | 383 DrmWindow* ScreenManager::FindWindowAt(const gfx::Rect& bounds) const { |
| 385 for (auto pair : window_map_) { | 384 for (auto pair : window_map_) { |
| 386 if (pair.second->bounds() == bounds) | 385 if (pair.second->bounds() == bounds) |
| 387 return pair.second; | 386 return pair.second; |
| 388 } | 387 } |
| 389 | 388 |
| 390 return nullptr; | 389 return nullptr; |
| 391 } | 390 } |
| 392 | 391 |
| 393 } // namespace ui | 392 } // namespace ui |
| OLD | NEW |