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

Side by Side Diff: ui/gl/gl_image.h

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 (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 #ifndef UI_GL_GL_IMAGE_H_ 5 #ifndef UI_GL_GL_IMAGE_H_
6 #define UI_GL_GL_IMAGE_H_ 6 #define UI_GL_GL_IMAGE_H_
7 7
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "ui/gfx/size.h" 9 #include "ui/gfx/size.h"
10 #include "ui/gl/gl_export.h" 10 #include "ui/gl/gl_export.h"
11 11
12 namespace gfx { 12 namespace gfx {
13 13
14 // Encapsulates an image that can be bound to a texture, hiding platform 14 // Encapsulates an image that can be bound to a texture, hiding platform
15 // specific management. 15 // specific management.
16 class GL_EXPORT GLImage : public base::RefCounted<GLImage> { 16 class GL_EXPORT GLImage : public base::RefCounted<GLImage> {
17 public: 17 public:
18 GLImage(); 18 GLImage();
19 19
20 // Destroys the image. 20 // Destroys the image.
21 virtual void Destroy() = 0; 21 virtual void Destroy(bool have_context) = 0;
22 22
23 // Get the size of the image. 23 // Get the size of the image.
24 virtual gfx::Size GetSize() = 0; 24 virtual gfx::Size GetSize() = 0;
25 25
26 // Bind image to texture currently bound to |target|. 26 // Bind image to texture currently bound to |target|.
27 virtual bool BindTexImage(unsigned target) = 0; 27 virtual bool BindTexImage(unsigned target) = 0;
28 28
29 // Release image from texture currently bound to |target|. 29 // Release image from texture currently bound to |target|.
30 virtual void ReleaseTexImage(unsigned target) = 0; 30 virtual void ReleaseTexImage(unsigned target) = 0;
31 31
(...skipping 18 matching lines...) Expand all
50 50
51 private: 51 private:
52 friend class base::RefCounted<GLImage>; 52 friend class base::RefCounted<GLImage>;
53 53
54 DISALLOW_COPY_AND_ASSIGN(GLImage); 54 DISALLOW_COPY_AND_ASSIGN(GLImage);
55 }; 55 };
56 56
57 } // namespace gfx 57 } // namespace gfx
58 58
59 #endif // UI_GL_GL_IMAGE_H_ 59 #endif // UI_GL_GL_IMAGE_H_
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/texture_definition.cc ('k') | ui/gl/gl_image_android_native_buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698