| 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/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 Loading... |
| 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 |
| OLD | NEW |