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

Side by Side Diff: content/common/gpu/gpu_memory_buffer_factory_ozone.cc

Issue 656133002: Add dmabuf support to ozone scanout buffers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 | « no previous file | ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_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 "content/common/gpu/gpu_memory_buffer_factory.h" 5 #include "content/common/gpu/gpu_memory_buffer_factory.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "ui/gl/gl_image.h" 8 #include "ui/gl/gl_image.h"
9 #include "ui/gl/gl_image_shared_memory.h" 9 #include "ui/gl/gl_image_shared_memory.h"
10 #include "ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_buffer.h" 10 #include "ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_buffer.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 return NULL; 56 return NULL;
57 57
58 return image; 58 return image;
59 } 59 }
60 case gfx::OZONE_NATIVE_BUFFER: 60 case gfx::OZONE_NATIVE_BUFFER:
61 // Verify that client is the owner of the buffer we're about to use. 61 // Verify that client is the owner of the buffer we're about to use.
62 if (handle.global_id.secondary_id != client_id) 62 if (handle.global_id.secondary_id != client_id)
63 return scoped_refptr<gfx::GLImage>(); 63 return scoped_refptr<gfx::GLImage>();
64 64
65 return ozone_buffer_factory_.CreateImageForGpuMemoryBuffer( 65 return ozone_buffer_factory_.CreateImageForGpuMemoryBuffer(
66 handle.global_id, size, internalformat); 66 handle.global_id, size, format, internalformat);
67 default: 67 default:
68 NOTREACHED(); 68 NOTREACHED();
69 return scoped_refptr<gfx::GLImage>(); 69 return scoped_refptr<gfx::GLImage>();
70 } 70 }
71 } 71 }
72 72
73 private: 73 private:
74 ui::GpuMemoryBufferFactoryOzoneNativeBuffer ozone_buffer_factory_; 74 ui::GpuMemoryBufferFactoryOzoneNativeBuffer ozone_buffer_factory_;
75 }; 75 };
76 76
77 } // namespace 77 } // namespace
78 78
79 // static 79 // static
80 scoped_ptr<GpuMemoryBufferFactory> GpuMemoryBufferFactory::Create() { 80 scoped_ptr<GpuMemoryBufferFactory> GpuMemoryBufferFactory::Create() {
81 return make_scoped_ptr<GpuMemoryBufferFactory>( 81 return make_scoped_ptr<GpuMemoryBufferFactory>(
82 new GpuMemoryBufferFactoryImpl); 82 new GpuMemoryBufferFactoryImpl);
83 } 83 }
84 84
85 } // namespace content 85 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698