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

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

Issue 1354483004: Re-land: ui: Add GLImage unit test framework. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 2 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 | « build/sanitizers/lsan_suppressions.cc ('k') | components/mus/BUILD.gn » ('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 "ui/gl/gl_image_shared_memory.h" 7 #include "ui/gl/gl_image_shared_memory.h"
8 8
9 namespace cc { 9 namespace cc {
10 10
11 TestImageFactory::TestImageFactory() { 11 TestImageFactory::TestImageFactory() {
12 } 12 }
13 13
14 TestImageFactory::~TestImageFactory() { 14 TestImageFactory::~TestImageFactory() {
15 } 15 }
16 16
17 scoped_refptr<gfx::GLImage> TestImageFactory::CreateImageForGpuMemoryBuffer( 17 scoped_refptr<gfx::GLImage> TestImageFactory::CreateImageForGpuMemoryBuffer(
18 const gfx::GpuMemoryBufferHandle& handle, 18 const gfx::GpuMemoryBufferHandle& handle,
19 const gfx::Size& size, 19 const gfx::Size& size,
20 gfx::BufferFormat format, 20 gfx::BufferFormat format,
21 unsigned internalformat, 21 unsigned internalformat,
22 int client_id) { 22 int client_id) {
23 DCHECK_EQ(handle.type, gfx::SHARED_MEMORY_BUFFER); 23 DCHECK_EQ(handle.type, gfx::SHARED_MEMORY_BUFFER);
24 24
25 scoped_refptr<gfx::GLImageSharedMemory> image( 25 scoped_refptr<gfx::GLImageSharedMemory> image(
26 new gfx::GLImageSharedMemory(size, internalformat)); 26 new gfx::GLImageSharedMemory(size, internalformat));
27 if (!image->Initialize(handle, format)) 27 if (!image->Initialize(handle.handle, handle.id, format))
28 return nullptr; 28 return nullptr;
29 29
30 return image; 30 return image;
31 } 31 }
32 32
33 } // namespace cc 33 } // namespace cc
OLDNEW
« no previous file with comments | « build/sanitizers/lsan_suppressions.cc ('k') | components/mus/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698