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

Unified Diff: ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_buffer.cc

Issue 1134993003: ozone: Implement zero/one-copy texture for Ozone GBM. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
Index: ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_buffer.cc
diff --git a/ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_buffer.cc b/ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_buffer.cc
index 51ff149976c75b71dda485ed30d42ae6305df825..2edae910d741ac9994870b7b472772ee199cf1ee 100644
--- a/ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_buffer.cc
+++ b/ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_buffer.cc
@@ -72,6 +72,7 @@ class GLImageOzoneNativePixmapDmaBuf : public gfx::GLImageLinuxDMABuffer {
gfx::OverlayTransform transform,
const gfx::Rect& bounds_rect,
const gfx::RectF& crop_rect) override {
+ DCHECK(pixmap_->GetBufferUsage() == NativePixmap::SCANOUT);
reveman 2015/05/11 16:40:57 nit: use DCHECK_EQ
dshwang 2015/05/14 12:25:47 Done.
return SurfaceFactoryOzone::GetInstance()->ScheduleOverlayPlane(
widget, z_order, transform, pixmap_, bounds_rect, crop_rect);
}
@@ -139,11 +140,12 @@ bool GpuMemoryBufferFactoryOzoneNativeBuffer::CreateGpuMemoryBuffer(
gfx::GpuMemoryBuffer::Format format,
gfx::GpuMemoryBuffer::Usage usage,
int client_id,
- gfx::PluginWindowHandle surface_handle) {
+ gfx::PluginWindowHandle surface_handle,
+ gfx::GpuMemoryBufferHandle* new_handle) {
scoped_refptr<NativePixmap> pixmap =
SurfaceFactoryOzone::GetInstance()->CreateNativePixmap(
surface_handle, size, GetOzoneFormatFor(format),
- GetOzoneUsageFor(usage));
+ GetOzoneUsageFor(usage), new_handle);
if (!pixmap.get()) {
LOG(ERROR) << "Failed to create pixmap " << size.width() << "x"
<< size.height() << " format " << format << ", usage " << usage;

Powered by Google App Engine
This is Rietveld 408576698