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

Side by Side Diff: content/common/gpu/client/gpu_memory_buffer_impl_ozone_native_buffer.cc

Issue 701033005: content: Move type selection logic out of GpuMemoryBufferImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove blank line and add missing CONTENT_EXPORT Created 6 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 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_buffer.h " 5 #include "content/common/gpu/client/gpu_memory_buffer_impl_ozone_native_buffer.h "
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "content/common/gpu/client/gpu_memory_buffer_factory_host.h" 8 #include "content/common/gpu/client/gpu_memory_buffer_factory_host.h"
9 #include "ui/gl/gl_bindings.h" 9 #include "ui/gl/gl_bindings.h"
10 10
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 case BGRA_8888: 124 case BGRA_8888:
125 return false; 125 return false;
126 } 126 }
127 127
128 NOTREACHED(); 128 NOTREACHED();
129 return false; 129 return false;
130 } 130 }
131 131
132 // static 132 // static
133 bool GpuMemoryBufferImplOzoneNativeBuffer::IsUsageSupported(Usage usage) { 133 bool GpuMemoryBufferImplOzoneNativeBuffer::IsUsageSupported(Usage usage) {
134 switch (usage) { 134 switch (usage) {
alexst (slow to review) 2014/11/11 21:05:49 I've been looking at the unittests, since there ar
reveman 2014/11/12 05:09:20 I made it use CanCreateNativePixmap in the SCANOUT
135 case MAP: 135 case MAP:
136 return false; 136 return false;
137 case SCANOUT: 137 case SCANOUT:
138 return true; 138 return true;
139 } 139 }
140 140
141 NOTREACHED(); 141 NOTREACHED();
142 return false; 142 return false;
143 } 143 }
144 144
145 // static
146 bool GpuMemoryBufferImplOzoneNativeBuffer::IsConfigurationSupported(
147 Format format,
148 Usage usage) {
149 return IsFormatSupported(format) && IsUsageSupported(usage);
150 }
151
152 void* GpuMemoryBufferImplOzoneNativeBuffer::Map() { 145 void* GpuMemoryBufferImplOzoneNativeBuffer::Map() {
153 NOTREACHED(); 146 NOTREACHED();
154 return NULL; 147 return NULL;
155 } 148 }
156 149
157 void GpuMemoryBufferImplOzoneNativeBuffer::Unmap() { 150 void GpuMemoryBufferImplOzoneNativeBuffer::Unmap() {
158 NOTREACHED(); 151 NOTREACHED();
159 } 152 }
160 153
161 uint32 GpuMemoryBufferImplOzoneNativeBuffer::GetStride() const { 154 uint32 GpuMemoryBufferImplOzoneNativeBuffer::GetStride() const {
162 NOTREACHED(); 155 NOTREACHED();
163 return 0; 156 return 0;
164 } 157 }
165 158
166 gfx::GpuMemoryBufferHandle GpuMemoryBufferImplOzoneNativeBuffer::GetHandle() 159 gfx::GpuMemoryBufferHandle GpuMemoryBufferImplOzoneNativeBuffer::GetHandle()
167 const { 160 const {
168 gfx::GpuMemoryBufferHandle handle; 161 gfx::GpuMemoryBufferHandle handle;
169 handle.type = gfx::OZONE_NATIVE_BUFFER; 162 handle.type = gfx::OZONE_NATIVE_BUFFER;
170 handle.id = id_; 163 handle.id = id_;
171 return handle; 164 return handle;
172 } 165 }
173 166
174 } // namespace content 167 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698