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

Side by Side Diff: gpu/command_buffer/service/texture_definition.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: resolve android clang dbg build issue. Created 6 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 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 "gpu/command_buffer/service/texture_definition.h" 5 #include "gpu/command_buffer/service/texture_definition.h"
6 6
7 #include <list> 7 #include <list>
8 8
9 #include "base/memory/linked_ptr.h" 9 #include "base/memory/linked_ptr.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 12 matching lines...) Expand all
23 namespace gles2 { 23 namespace gles2 {
24 24
25 namespace { 25 namespace {
26 26
27 class GLImageSync : public gfx::GLImage { 27 class GLImageSync : public gfx::GLImage {
28 public: 28 public:
29 explicit GLImageSync(const scoped_refptr<NativeImageBuffer>& buffer, 29 explicit GLImageSync(const scoped_refptr<NativeImageBuffer>& buffer,
30 const gfx::Size& size); 30 const gfx::Size& size);
31 31
32 // Implement GLImage. 32 // Implement GLImage.
33 virtual void Destroy() OVERRIDE; 33 virtual void Destroy(bool have_context) OVERRIDE;
34 virtual gfx::Size GetSize() OVERRIDE; 34 virtual gfx::Size GetSize() OVERRIDE;
35 virtual bool BindTexImage(unsigned target) OVERRIDE; 35 virtual bool BindTexImage(unsigned target) OVERRIDE;
36 virtual void ReleaseTexImage(unsigned target) OVERRIDE; 36 virtual void ReleaseTexImage(unsigned target) OVERRIDE;
37 virtual void WillUseTexImage() OVERRIDE; 37 virtual void WillUseTexImage() OVERRIDE;
38 virtual void WillModifyTexImage() OVERRIDE; 38 virtual void WillModifyTexImage() OVERRIDE;
39 virtual void DidModifyTexImage() OVERRIDE; 39 virtual void DidModifyTexImage() OVERRIDE;
40 40
41 virtual void DidUseTexImage() OVERRIDE; 41 virtual void DidUseTexImage() OVERRIDE;
42 virtual void SetReleaseAfterUse() OVERRIDE; 42 virtual void SetReleaseAfterUse() OVERRIDE;
43 43
(...skipping 12 matching lines...) Expand all
56 : buffer_(buffer), size_(size) { 56 : buffer_(buffer), size_(size) {
57 if (buffer) 57 if (buffer)
58 buffer->AddClient(this); 58 buffer->AddClient(this);
59 } 59 }
60 60
61 GLImageSync::~GLImageSync() { 61 GLImageSync::~GLImageSync() {
62 if (buffer_) 62 if (buffer_)
63 buffer_->RemoveClient(this); 63 buffer_->RemoveClient(this);
64 } 64 }
65 65
66 void GLImageSync::Destroy() {} 66 void GLImageSync::Destroy(bool have_context) {
67 }
67 68
68 gfx::Size GLImageSync::GetSize() { 69 gfx::Size GLImageSync::GetSize() {
69 return size_; 70 return size_;
70 } 71 }
71 72
72 bool GLImageSync::BindTexImage(unsigned target) { 73 bool GLImageSync::BindTexImage(unsigned target) {
73 NOTREACHED(); 74 NOTREACHED();
74 return false; 75 return false;
75 } 76 }
76 77
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 474
474 // All structural changes should have orphaned the texture. 475 // All structural changes should have orphaned the texture.
475 if (image_buffer_ && !texture->GetLevelImage(texture->target(), 0)) 476 if (image_buffer_ && !texture->GetLevelImage(texture->target(), 0))
476 return false; 477 return false;
477 478
478 return true; 479 return true;
479 } 480 }
480 481
481 } // namespace gles2 482 } // namespace gles2
482 } // namespace gpu 483 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/stream_texture_manager_in_process_android.cc ('k') | ui/gl/gl_image.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698