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

Side by Side Diff: ui/ozone/platform/drm/gpu/drm_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_buffer.h ('k') | ui/ozone/platform/drm/gpu/drm_console_buffer.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_buffer.h" 5 #include "ui/ozone/platform/drm/gpu/drm_buffer.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "ui/ozone/platform/drm/gpu/drm_device.h" 8 #include "ui/ozone/platform/drm/gpu/drm_device.h"
9 9
10 namespace ui { 10 namespace ui {
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 } 65 }
66 66
67 if (should_register_framebuffer && 67 if (should_register_framebuffer &&
68 !drm_->AddFramebuffer( 68 !drm_->AddFramebuffer(
69 info.width(), info.height(), GetColorDepth(info.colorType()), 69 info.width(), info.height(), GetColorDepth(info.colorType()),
70 info.bytesPerPixel() << 3, stride_, handle_, &framebuffer_)) { 70 info.bytesPerPixel() << 3, stride_, handle_, &framebuffer_)) {
71 PLOG(ERROR) << "DrmBuffer: AddFramebuffer: handle " << handle_; 71 PLOG(ERROR) << "DrmBuffer: AddFramebuffer: handle " << handle_;
72 return false; 72 return false;
73 } 73 }
74 74
75 surface_ = 75 surface_ = SkSurface::MakeRasterDirect(info, mmap_base_, stride_);
76 skia::AdoptRef(SkSurface::NewRasterDirect(info, mmap_base_, stride_));
77 if (!surface_) { 76 if (!surface_) {
78 LOG(ERROR) << "DrmBuffer: Failed to create SkSurface: handle " << handle_; 77 LOG(ERROR) << "DrmBuffer: Failed to create SkSurface: handle " << handle_;
79 return false; 78 return false;
80 } 79 }
81 80
82 return true; 81 return true;
83 } 82 }
84 83
85 SkCanvas* DrmBuffer::GetCanvas() const { 84 SkCanvas* DrmBuffer::GetCanvas() const {
86 return surface_->getCanvas(); 85 return surface_->getCanvas();
(...skipping 22 matching lines...) Expand all
109 const gfx::Size& size) { 108 const gfx::Size& size) {
110 scoped_refptr<DrmBuffer> buffer(new DrmBuffer(drm)); 109 scoped_refptr<DrmBuffer> buffer(new DrmBuffer(drm));
111 SkImageInfo info = SkImageInfo::MakeN32Premul(size.width(), size.height()); 110 SkImageInfo info = SkImageInfo::MakeN32Premul(size.width(), size.height());
112 if (!buffer->Initialize(info, true /* should_register_framebuffer */)) 111 if (!buffer->Initialize(info, true /* should_register_framebuffer */))
113 return NULL; 112 return NULL;
114 113
115 return buffer; 114 return buffer;
116 } 115 }
117 116
118 } // namespace ui 117 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/drm/gpu/drm_buffer.h ('k') | ui/ozone/platform/drm/gpu/drm_console_buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698