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

Side by Side Diff: ui/ozone/platform/drm/gpu/drm_console_buffer.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
« no previous file with comments | « ui/ozone/platform/drm/gpu/drm_console_buffer.h ('k') | ui/ozone/platform/drm/gpu/drm_surface.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/drm_console_buffer.h" 5 #include "ui/ozone/platform/drm/gpu/drm_console_buffer.h"
6 6
7 #include <sys/mman.h> 7 #include <sys/mman.h>
8 #include <xf86drmMode.h> 8 #include <xf86drmMode.h>
9 9
10 #include "third_party/skia/include/core/SkCanvas.h" 10 #include "third_party/skia/include/core/SkCanvas.h"
(...skipping 26 matching lines...) Expand all
37 stride_ = fb->pitch; 37 stride_ = fb->pitch;
38 SkImageInfo info = SkImageInfo::MakeN32Premul(fb->width, fb->height); 38 SkImageInfo info = SkImageInfo::MakeN32Premul(fb->width, fb->height);
39 39
40 mmap_size_ = info.getSafeSize(stride_); 40 mmap_size_ = info.getSafeSize(stride_);
41 41
42 if (!drm_->MapDumbBuffer(fb->handle, mmap_size_, &mmap_base_)) { 42 if (!drm_->MapDumbBuffer(fb->handle, mmap_size_, &mmap_base_)) {
43 mmap_base_ = NULL; 43 mmap_base_ = NULL;
44 return false; 44 return false;
45 } 45 }
46 46
47 surface_ = 47 surface_ = SkSurface::MakeRasterDirect(info, mmap_base_, stride_);
48 skia::AdoptRef(SkSurface::NewRasterDirect(info, mmap_base_, stride_));
49 if (!surface_) 48 if (!surface_)
50 return false; 49 return false;
51 50
52 return true; 51 return true;
53 } 52 }
54 53
55 } // namespace ui 54 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/drm/gpu/drm_console_buffer.h ('k') | ui/ozone/platform/drm/gpu/drm_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698