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

Side by Side Diff: content/child/child_thread_impl_browsertest.cc

Issue 1281043006: Move NumberOfPlanesForGpuMemoryBufferFormat to gfx (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix build warning again 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/memory/discardable_memory.h" 7 #include "base/memory/discardable_memory.h"
8 #include "base/memory/scoped_vector.h" 8 #include "base/memory/scoped_vector.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "content/child/child_discardable_shared_memory_manager.h" 10 #include "content/child/child_discardable_shared_memory_manager.h"
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 DISABLED_Map) { 150 DISABLED_Map) {
151 gfx::BufferFormat format = ::testing::get<1>(GetParam()); 151 gfx::BufferFormat format = ::testing::get<1>(GetParam());
152 gfx::Size buffer_size(4, 4); 152 gfx::Size buffer_size(4, 4);
153 153
154 scoped_ptr<gfx::GpuMemoryBuffer> buffer = 154 scoped_ptr<gfx::GpuMemoryBuffer> buffer =
155 child_gpu_memory_buffer_manager()->AllocateGpuMemoryBuffer( 155 child_gpu_memory_buffer_manager()->AllocateGpuMemoryBuffer(
156 buffer_size, format, gfx::BufferUsage::MAP); 156 buffer_size, format, gfx::BufferUsage::MAP);
157 ASSERT_TRUE(buffer); 157 ASSERT_TRUE(buffer);
158 EXPECT_EQ(format, buffer->GetFormat()); 158 EXPECT_EQ(format, buffer->GetFormat());
159 159
160 size_t num_planes = 160 size_t num_planes = gfx::GpuMemoryBuffer::NumberOfPlanes(format);
161 GpuMemoryBufferImpl::NumberOfPlanesForGpuMemoryBufferFormat(format);
162 161
163 // Map buffer planes. 162 // Map buffer planes.
164 scoped_ptr<void* []> planes(new void* [num_planes]); 163 scoped_ptr<void* []> planes(new void* [num_planes]);
165 bool rv = buffer->Map(planes.get()); 164 bool rv = buffer->Map(planes.get());
166 ASSERT_TRUE(rv); 165 ASSERT_TRUE(rv);
167 EXPECT_TRUE(buffer->IsMapped()); 166 EXPECT_TRUE(buffer->IsMapped());
168 167
169 // Get strides. 168 // Get strides.
170 scoped_ptr<int[]> strides(new int[num_planes]); 169 scoped_ptr<int[]> strides(new int[num_planes]);
171 buffer->GetStride(strides.get()); 170 buffer->GetStride(strides.get());
(...skipping 29 matching lines...) Expand all
201 kEnableNativeBuffers), 200 kEnableNativeBuffers),
202 // These formats are guaranteed to work on all platforms. 201 // These formats are guaranteed to work on all platforms.
203 ::testing::Values(gfx::BufferFormat::R_8, 202 ::testing::Values(gfx::BufferFormat::R_8,
204 gfx::BufferFormat::RGBA_4444, 203 gfx::BufferFormat::RGBA_4444,
205 gfx::BufferFormat::RGBA_8888, 204 gfx::BufferFormat::RGBA_8888,
206 gfx::BufferFormat::BGRA_8888, 205 gfx::BufferFormat::BGRA_8888,
207 gfx::BufferFormat::YUV_420))); 206 gfx::BufferFormat::YUV_420)));
208 207
209 } // namespace 208 } // namespace
210 } // namespace content 209 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698