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

Side by Side Diff: ui/ozone/platform/drm/gpu/screen_manager.cc

Issue 2011713003: Roll skia to 8cc209111876b7c78b5ec577c9221d8ed5e21024 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 6 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
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/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 "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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 } 51 }
52 52
53 // Don't copy anything if the sizes mismatch. This can happen when the user 53 // Don't copy anything if the sizes mismatch. This can happen when the user
54 // changes modes. 54 // changes modes.
55 if (saved_buffer.canvas()->getBaseLayerSize() != 55 if (saved_buffer.canvas()->getBaseLayerSize() !=
56 modeset_buffer.canvas()->getBaseLayerSize()) { 56 modeset_buffer.canvas()->getBaseLayerSize()) {
57 VLOG(2) << "Previous buffer has a different size than modeset buffer"; 57 VLOG(2) << "Previous buffer has a different size than modeset buffer";
58 return; 58 return;
59 } 59 }
60 60
61 skia::RefPtr<SkImage> image = saved_buffer.image(); 61 sk_sp<SkImage> image = saved_buffer.image();
62 SkPaint paint; 62 SkPaint paint;
63 // Copy the source buffer. Do not perform any blending. 63 // Copy the source buffer. Do not perform any blending.
64 paint.setXfermodeMode(SkXfermode::kSrc_Mode); 64 paint.setXfermodeMode(SkXfermode::kSrc_Mode);
65 modeset_buffer.canvas()->drawImage(image.get(), 0, 0, &paint); 65 modeset_buffer.canvas()->drawImage(image.get(), 0, 0, &paint);
66 } 66 }
67 67
68 } // namespace 68 } // namespace
69 69
70 ScreenManager::ScreenManager(ScanoutBufferGenerator* buffer_generator) 70 ScreenManager::ScreenManager(ScanoutBufferGenerator* buffer_generator)
71 : buffer_generator_(buffer_generator) { 71 : buffer_generator_(buffer_generator) {
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 DrmWindow* ScreenManager::FindWindowAt(const gfx::Rect& bounds) const { 339 DrmWindow* ScreenManager::FindWindowAt(const gfx::Rect& bounds) const {
340 for (auto pair : window_map_) { 340 for (auto pair : window_map_) {
341 if (pair.second->bounds() == bounds) 341 if (pair.second->bounds() == bounds)
342 return pair.second; 342 return pair.second;
343 } 343 }
344 344
345 return nullptr; 345 return nullptr;
346 } 346 }
347 347
348 } // namespace ui 348 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/drm/gpu/drm_window_unittest.cc ('k') | ui/ozone/platform/drm/test/mock_drm_device.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698