| 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/screen_manager.h" | 5 #include "ui/ozone/platform/dri/screen_manager.h" |
| 6 | 6 |
| 7 #include <xf86drmMode.h> | 7 #include <xf86drmMode.h> |
| 8 | 8 |
| 9 #include "third_party/skia/include/core/SkCanvas.h" | 9 #include "third_party/skia/include/core/SkCanvas.h" |
| 10 #include "ui/gfx/geometry/point.h" | 10 #include "ui/gfx/geometry/point.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 return; | 47 return; |
| 48 } | 48 } |
| 49 | 49 |
| 50 // Don't copy anything if the sizes mismatch. This can happen when the user | 50 // Don't copy anything if the sizes mismatch. This can happen when the user |
| 51 // changes modes. | 51 // changes modes. |
| 52 if (saved_buffer.canvas()->getBaseLayerSize() != | 52 if (saved_buffer.canvas()->getBaseLayerSize() != |
| 53 modeset_buffer.canvas()->getBaseLayerSize()) | 53 modeset_buffer.canvas()->getBaseLayerSize()) |
| 54 return; | 54 return; |
| 55 | 55 |
| 56 skia::RefPtr<SkImage> image = saved_buffer.image(); | 56 skia::RefPtr<SkImage> image = saved_buffer.image(); |
| 57 modeset_buffer.canvas()->drawImage(image.get(), 0, 0); | 57 SkPaint paint; |
| 58 // Copy the source buffer. Do not perform any blending. |
| 59 paint.setXfermodeMode(SkXfermode::kSrc_Mode); |
| 60 modeset_buffer.canvas()->drawImage(image.get(), 0, 0, &paint); |
| 58 } | 61 } |
| 59 | 62 |
| 60 } // namespace | 63 } // namespace |
| 61 | 64 |
| 62 ScreenManager::ScreenManager(ScanoutBufferGenerator* buffer_generator) | 65 ScreenManager::ScreenManager(ScanoutBufferGenerator* buffer_generator) |
| 63 : buffer_generator_(buffer_generator) { | 66 : buffer_generator_(buffer_generator) { |
| 64 } | 67 } |
| 65 | 68 |
| 66 ScreenManager::~ScreenManager() { | 69 ScreenManager::~ScreenManager() { |
| 67 } | 70 } |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 | 267 |
| 265 // When things go wrong revert back to the previous configuration since | 268 // When things go wrong revert back to the previous configuration since |
| 266 // it is expected that the configuration would not have changed if | 269 // it is expected that the configuration would not have changed if |
| 267 // things fail. | 270 // things fail. |
| 268 (*original)->AddCrtc((*mirror)->RemoveCrtc(drm, crtc)); | 271 (*original)->AddCrtc((*mirror)->RemoveCrtc(drm, crtc)); |
| 269 (*original)->Enable(); | 272 (*original)->Enable(); |
| 270 return false; | 273 return false; |
| 271 } | 274 } |
| 272 | 275 |
| 273 } // namespace ui | 276 } // namespace ui |
| OLD | NEW |