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

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

Issue 301793003: During image destroy, delete textures only if we have a GL context. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Destroy GLImage during ContextGroup destroy Created 6 years, 6 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 (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 void ImageManager::Destroy(bool have_context) {
19 for (GLImageMap::const_iterator iter = gl_images_.begin();
20 iter != gl_images_.end();
21 ++iter)
22 iter->second.get()->Destroy(have_context);
reveman 2014/05/29 16:30:34 should we drop the ref here too?
23 }
24
18 void ImageManager::RegisterGpuMemoryBuffer(int32 id, 25 void ImageManager::RegisterGpuMemoryBuffer(int32 id,
19 gfx::GpuMemoryBufferHandle buffer, 26 gfx::GpuMemoryBufferHandle buffer,
20 size_t width, 27 size_t width,
21 size_t height, 28 size_t height,
22 unsigned internalformat) { 29 unsigned internalformat) {
23 if (id <= 0) { 30 if (id <= 0) {
24 DVLOG(0) << "Cannot register GPU memory buffer with non-positive ID."; 31 DVLOG(0) << "Cannot register GPU memory buffer with non-positive ID.";
25 return; 32 return;
26 } 33 }
27 34
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 69
63 return NULL; 70 return NULL;
64 } 71 }
65 72
66 void ImageManager::SetReleaseAfterUse() { 73 void ImageManager::SetReleaseAfterUse() {
67 release_after_use_ = true; 74 release_after_use_ = true;
68 } 75 }
69 76
70 } // namespace gles2 77 } // namespace gles2
71 } // namespace gpu 78 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698