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

Side by Side Diff: gpu/ipc/client/gpu_memory_buffer_impl.cc

Issue 2487783003: gpu: Directly cast ClientBuffer to gfx::GpuMemoryBuffer (Closed)
Patch Set: . Created 4 years, 1 month 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "gpu/ipc/client/gpu_memory_buffer_impl.h" 5 #include "gpu/ipc/client/gpu_memory_buffer_impl.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "gpu/ipc/client/gpu_memory_buffer_impl_shared_memory.h" 9 #include "gpu/ipc/client/gpu_memory_buffer_impl_shared_memory.h"
10 10
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 case gfx::OZONE_NATIVE_PIXMAP: 53 case gfx::OZONE_NATIVE_PIXMAP:
54 return GpuMemoryBufferImplOzoneNativePixmap::CreateFromHandle( 54 return GpuMemoryBufferImplOzoneNativePixmap::CreateFromHandle(
55 handle, size, format, usage, callback); 55 handle, size, format, usage, callback);
56 #endif 56 #endif
57 default: 57 default:
58 NOTREACHED(); 58 NOTREACHED();
59 return nullptr; 59 return nullptr;
60 } 60 }
61 } 61 }
62 62
63 // static
64 GpuMemoryBufferImpl* GpuMemoryBufferImpl::FromClientBuffer(
65 ClientBuffer buffer) {
66 return reinterpret_cast<GpuMemoryBufferImpl*>(buffer);
67 }
68
69 gfx::Size GpuMemoryBufferImpl::GetSize() const { 63 gfx::Size GpuMemoryBufferImpl::GetSize() const {
70 return size_; 64 return size_;
71 } 65 }
72 66
73 gfx::BufferFormat GpuMemoryBufferImpl::GetFormat() const { 67 gfx::BufferFormat GpuMemoryBufferImpl::GetFormat() const {
74 return format_; 68 return format_;
75 } 69 }
76 70
77 gfx::GpuMemoryBufferId GpuMemoryBufferImpl::GetId() const { 71 gfx::GpuMemoryBufferId GpuMemoryBufferImpl::GetId() const {
78 return id_; 72 return id_;
79 } 73 }
80 74
81 ClientBuffer GpuMemoryBufferImpl::AsClientBuffer() { 75 ClientBuffer GpuMemoryBufferImpl::AsClientBuffer() {
82 return reinterpret_cast<ClientBuffer>(this); 76 return reinterpret_cast<ClientBuffer>(this);
83 } 77 }
84 78
85 } // namespace gpu 79 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/ipc/client/gpu_memory_buffer_impl.h ('k') | services/ui/public/cpp/mojo_gpu_memory_buffer_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698