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

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

Issue 1078253002: gfx namespace cleanup. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 | gpu/command_buffer/tests/gl_gpu_memory_buffer_unittest.cc » ('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 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 "content/common/gpu/client/gpu_memory_buffer_impl.h" 5 #include "content/common/gpu/client/gpu_memory_buffer_impl.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/numerics/safe_math.h" 8 #include "base/numerics/safe_math.h"
9 #include "content/common/gpu/client/gpu_memory_buffer_impl_shared_memory.h" 9 #include "content/common/gpu/client/gpu_memory_buffer_impl_shared_memory.h"
10 #include "ui/gl/gl_bindings.h" 10 #include "ui/gl/gl_bindings.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 checked_stride *= 4; 128 checked_stride *= 4;
129 if (!checked_stride.IsValid()) 129 if (!checked_stride.IsValid())
130 return false; 130 return false;
131 *stride_in_bytes = checked_stride.ValueOrDie(); 131 *stride_in_bytes = checked_stride.ValueOrDie();
132 return true; 132 return true;
133 case YUV_420: 133 case YUV_420:
134 DCHECK_EQ(width % 2, 0u); 134 DCHECK_EQ(width % 2, 0u);
135 *stride_in_bytes = width / SubsamplingFactor(format, plane); 135 *stride_in_bytes = width / SubsamplingFactor(format, plane);
136 return true; 136 return true;
137 } 137 }
138
139 NOTREACHED(); 138 NOTREACHED();
140 return false; 139 return false;
141 } 140 }
142 141
143 // static 142 // static
144 size_t GpuMemoryBufferImpl::SubsamplingFactor( 143 size_t GpuMemoryBufferImpl::SubsamplingFactor(
145 Format format, 144 Format format,
146 int plane) { 145 int plane) {
147 switch (format) { 146 switch (format) {
148 case ATC: 147 case ATC:
(...skipping 22 matching lines...) Expand all
171 170
172 bool GpuMemoryBufferImpl::IsMapped() const { 171 bool GpuMemoryBufferImpl::IsMapped() const {
173 return mapped_; 172 return mapped_;
174 } 173 }
175 174
176 ClientBuffer GpuMemoryBufferImpl::AsClientBuffer() { 175 ClientBuffer GpuMemoryBufferImpl::AsClientBuffer() {
177 return reinterpret_cast<ClientBuffer>(this); 176 return reinterpret_cast<ClientBuffer>(this);
178 } 177 }
179 178
180 } // namespace content 179 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | gpu/command_buffer/tests/gl_gpu_memory_buffer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698