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

Side by Side Diff: cc/test/test_image_factory.cc

Issue 1539203002: Switch to standard integer types in cc/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more includes Created 5 years 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 | « cc/test/test_image_factory.h ('k') | cc/test/test_in_process_context_provider.h » ('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 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 "cc/test/test_image_factory.h" 5 #include "cc/test/test_image_factory.h"
6 6
7 #include <stddef.h>
8
7 #include "base/numerics/safe_conversions.h" 9 #include "base/numerics/safe_conversions.h"
8 #include "ui/gl/gl_image_shared_memory.h" 10 #include "ui/gl/gl_image_shared_memory.h"
9 11
10 namespace cc { 12 namespace cc {
11 13
12 TestImageFactory::TestImageFactory() { 14 TestImageFactory::TestImageFactory() {
13 } 15 }
14 16
15 TestImageFactory::~TestImageFactory() { 17 TestImageFactory::~TestImageFactory() {
16 } 18 }
17 19
18 scoped_refptr<gl::GLImage> TestImageFactory::CreateImageForGpuMemoryBuffer( 20 scoped_refptr<gl::GLImage> TestImageFactory::CreateImageForGpuMemoryBuffer(
19 const gfx::GpuMemoryBufferHandle& handle, 21 const gfx::GpuMemoryBufferHandle& handle,
20 const gfx::Size& size, 22 const gfx::Size& size,
21 gfx::BufferFormat format, 23 gfx::BufferFormat format,
22 unsigned internalformat, 24 unsigned internalformat,
23 int client_id) { 25 int client_id) {
24 DCHECK_EQ(handle.type, gfx::SHARED_MEMORY_BUFFER); 26 DCHECK_EQ(handle.type, gfx::SHARED_MEMORY_BUFFER);
25 27
26 scoped_refptr<gl::GLImageSharedMemory> image( 28 scoped_refptr<gl::GLImageSharedMemory> image(
27 new gl::GLImageSharedMemory(size, internalformat)); 29 new gl::GLImageSharedMemory(size, internalformat));
28 if (!image->Initialize(handle.handle, handle.id, format, handle.offset, 30 if (!image->Initialize(handle.handle, handle.id, format, handle.offset,
29 base::checked_cast<size_t>(handle.stride))) 31 base::checked_cast<size_t>(handle.stride)))
30 return nullptr; 32 return nullptr;
31 33
32 return image; 34 return image;
33 } 35 }
34 36
35 } // namespace cc 37 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/test_image_factory.h ('k') | cc/test/test_in_process_context_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698