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

Unified Diff: ui/ozone/platform/dri/dri_buffer.cc

Issue 959953002: [Ozone-Dri] Do not call AddFramebuffer with cursor buffers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/ozone/platform/dri/dri_buffer.h ('k') | ui/ozone/platform/dri/dri_surface.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/dri/dri_buffer.cc
diff --git a/ui/ozone/platform/dri/dri_buffer.cc b/ui/ozone/platform/dri/dri_buffer.cc
index 547b3ca666186c84b9d00eb44e185b6553be77fe..9fa284f2d39611c73f772ca191944020752fac7e 100644
--- a/ui/ozone/platform/dri/dri_buffer.cc
+++ b/ui/ozone/platform/dri/dri_buffer.cc
@@ -53,20 +53,18 @@ DriBuffer::~DriBuffer() {
dri_->DestroyDumbBuffer(info, handle_, stride_, pixels);
}
-bool DriBuffer::Initialize(const SkImageInfo& info) {
+bool DriBuffer::Initialize(const SkImageInfo& info,
+ bool should_register_framebuffer) {
void* pixels = NULL;
if (!dri_->CreateDumbBuffer(info, &handle_, &stride_, &pixels)) {
VLOG(2) << "Cannot create drm dumb buffer";
return false;
}
- if (!dri_->AddFramebuffer(info.width(),
- info.height(),
- GetColorDepth(info.colorType()),
- info.bytesPerPixel() << 3,
- stride_,
- handle_,
- &framebuffer_)) {
+ if (should_register_framebuffer &&
+ !dri_->AddFramebuffer(
+ info.width(), info.height(), GetColorDepth(info.colorType()),
+ info.bytesPerPixel() << 3, stride_, handle_, &framebuffer_)) {
VLOG(2) << "Failed to register framebuffer: " << strerror(errno);
return false;
}
@@ -106,7 +104,7 @@ scoped_refptr<ScanoutBuffer> DriBufferGenerator::Create(
const gfx::Size& size) {
scoped_refptr<DriBuffer> buffer(new DriBuffer(drm));
SkImageInfo info = SkImageInfo::MakeN32Premul(size.width(), size.height());
- if (!buffer->Initialize(info))
+ if (!buffer->Initialize(info, true /* should_register_framebuffer */))
return NULL;
return buffer;
« no previous file with comments | « ui/ozone/platform/dri/dri_buffer.h ('k') | ui/ozone/platform/dri/dri_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698