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

Side by Side Diff: gpu/command_buffer/service/image_manager.cc

Issue 255713008: Change glimage to accept a type. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: no ozone Created 6 years, 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "gpu/command_buffer/service/image_manager.h" 5 #include "gpu/command_buffer/service/image_manager.h"
6 6
7 #include "ui/gl/gl_image.h" 7 #include "ui/gl/gl_image.h"
8 8
9 namespace gpu { 9 namespace gpu {
10 namespace gles2 { 10 namespace gles2 {
11 11
12 ImageManager::ImageManager() : release_after_use_(false) { 12 ImageManager::ImageManager() : release_after_use_(false) {
13 } 13 }
14 14
15 ImageManager::~ImageManager() { 15 ImageManager::~ImageManager() {
16 } 16 }
17 17
18 bool ImageManager::RegisterGpuMemoryBuffer(int32 id, 18 bool ImageManager::RegisterGpuMemoryBuffer(int32 id,
19 gfx::GpuMemoryBufferHandle buffer, 19 gfx::GpuMemoryBufferHandle buffer,
20 size_t width, 20 size_t width,
21 size_t height, 21 size_t height,
22 unsigned internalformat) { 22 unsigned internalformat,
23 unsigned usage) {
23 if (id <= 0) { 24 if (id <= 0) {
24 DVLOG(0) << "Cannot register GPU memory buffer with non-positive ID."; 25 DVLOG(0) << "Cannot register GPU memory buffer with non-positive ID.";
25 return false; 26 return false;
26 } 27 }
27 28
28 if (LookupImage(id)) { 29 if (LookupImage(id)) {
29 DVLOG(0) << "GPU memory buffer ID already in use."; 30 DVLOG(0) << "GPU memory buffer ID already in use.";
30 return false; 31 return false;
31 } 32 }
32 33
(...skipping 30 matching lines...) Expand all
63 64
64 return NULL; 65 return NULL;
65 } 66 }
66 67
67 void ImageManager::SetReleaseAfterUse() { 68 void ImageManager::SetReleaseAfterUse() {
68 release_after_use_ = true; 69 release_after_use_ = true;
69 } 70 }
70 71
71 } // namespace gles2 72 } // namespace gles2
72 } // namespace gpu 73 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698