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

Side by Side Diff: content/common/gpu/client/gpu_memory_buffer_impl_ozone_native_pixmap.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: update from reveman's comments Created 5 years, 4 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/platform/drm/BUILD.gn » ('j') | ui/ozone/platform/drm/BUILD.gn » ('J')
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/client/gpu_memory_buffer_impl_ozone_native_pixmap.h " 5 #include "content/common/gpu/client/gpu_memory_buffer_impl_ozone_native_pixmap.h "
6 6
7 #include "ui/ozone/public/client_native_pixmap_factory.h" 7 #include "ui/ozone/public/client_native_pixmap_factory.h"
8 #include "ui/ozone/public/surface_factory_ozone.h" 8 #include "ui/ozone/public/surface_factory_ozone.h"
9 9
10 namespace content { 10 namespace content {
(...skipping 20 matching lines...) Expand all
31 ui::ClientNativePixmapFactory::GetInstance()->ImportFromHandle( 31 ui::ClientNativePixmapFactory::GetInstance()->ImportFromHandle(
32 handle.native_pixmap_handle, size, format, usage); 32 handle.native_pixmap_handle, size, format, usage);
33 if (!native_pixmap) 33 if (!native_pixmap)
34 return nullptr; 34 return nullptr;
35 return make_scoped_ptr<GpuMemoryBufferImpl>( 35 return make_scoped_ptr<GpuMemoryBufferImpl>(
36 new GpuMemoryBufferImplOzoneNativePixmap(handle.id, size, format, 36 new GpuMemoryBufferImplOzoneNativePixmap(handle.id, size, format,
37 callback, native_pixmap.Pass())); 37 callback, native_pixmap.Pass()));
38 } 38 }
39 39
40 bool GpuMemoryBufferImplOzoneNativePixmap::Map(void** data) { 40 bool GpuMemoryBufferImplOzoneNativePixmap::Map(void** data) {
41 return pixmap_->Map(data); 41 bool result = pixmap_->Map(data);
42 DCHECK(result);
43 mapped_ = true;
44 return result;
reveman 2015/08/12 22:32:25 nit: return true;
42 } 45 }
43 46
44 void GpuMemoryBufferImplOzoneNativePixmap::Unmap() { 47 void GpuMemoryBufferImplOzoneNativePixmap::Unmap() {
45 pixmap_->Unmap(); 48 pixmap_->Unmap();
49 mapped_ = false;
46 } 50 }
47 51
48 void GpuMemoryBufferImplOzoneNativePixmap::GetStride(int* stride) const { 52 void GpuMemoryBufferImplOzoneNativePixmap::GetStride(int* stride) const {
49 pixmap_->GetStride(stride); 53 pixmap_->GetStride(stride);
50 } 54 }
51 55
52 gfx::GpuMemoryBufferHandle GpuMemoryBufferImplOzoneNativePixmap::GetHandle() 56 gfx::GpuMemoryBufferHandle GpuMemoryBufferImplOzoneNativePixmap::GetHandle()
53 const { 57 const {
54 gfx::GpuMemoryBufferHandle handle; 58 gfx::GpuMemoryBufferHandle handle;
55 handle.type = gfx::OZONE_NATIVE_PIXMAP; 59 handle.type = gfx::OZONE_NATIVE_PIXMAP;
56 handle.id = id_; 60 handle.id = id_;
57 return handle; 61 return handle;
58 } 62 }
59 63
60 } // namespace content 64 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | ui/ozone/platform/drm/BUILD.gn » ('j') | ui/ozone/platform/drm/BUILD.gn » ('J')

Powered by Google App Engine
This is Rietveld 408576698