Index: ui/ozone/platform/drm/gpu/gbm_buffer.cc |
diff --git a/ui/ozone/platform/drm/gpu/gbm_buffer.cc b/ui/ozone/platform/drm/gpu/gbm_buffer.cc |
index 362f77c8dd6566ca08c6b26fea9341c950f3e8ff..d72806469750313e09697cc5864fb9b463763361 100644 |
--- a/ui/ozone/platform/drm/gpu/gbm_buffer.cc |
+++ b/ui/ozone/platform/drm/gpu/gbm_buffer.cc |
@@ -11,6 +11,7 @@ |
#include "base/logging.h" |
#include "base/trace_event/trace_event.h" |
+#include "ui/gfx/gpu_memory_buffer.h" |
reveman
2015/05/14 13:22:03
This code should not know about GpuMemoryBuffers.
|
#include "ui/ozone/platform/drm/gpu/gbm_device.h" |
namespace ui { |
@@ -51,8 +52,9 @@ scoped_refptr<GbmBuffer> GbmBuffer::CreateBuffer( |
TRACE_EVENT2("drm", "GbmBuffer::CreateBuffer", "device", |
gbm->device_path().value(), "size", size.ToString()); |
unsigned flags = GBM_BO_USE_RENDERING; |
- if (scanout) |
- flags |= GBM_BO_USE_SCANOUT; |
+ // SCANOUT allocates continuous memory, so better for performance even if |
+ // |scanout| is false. |
+ flags |= GBM_BO_USE_SCANOUT; |
gbm_bo* bo = gbm_bo_create(gbm->device(), size.width(), size.height(), |
GetGbmFormatFromBufferFormat(format), flags); |
if (!bo) |
@@ -98,4 +100,8 @@ int GbmPixmap::GetDmaBufPitch() { |
return gbm_bo_get_stride(buffer_->bo()); |
} |
+NativePixmap::BufferUsage GbmPixmap::GetBufferUsage() const { |
+ return buffer_->GetFramebufferId() ? SCANOUT : MAP; |
+} |
+ |
} // namespace ui |