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

Side by Side Diff: ui/gl/gl_image_memory.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
« no previous file with comments | « ui/gl/gl_image_io_surface.cc ('k') | ui/gl/gl_image_memory.cc » ('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 #ifndef UI_GL_GL_IMAGE_MEMORY_H_ 5 #ifndef UI_GL_GL_IMAGE_MEMORY_H_
6 #define UI_GL_GL_IMAGE_MEMORY_H_ 6 #define UI_GL_GL_IMAGE_MEMORY_H_
7 7
8 #include "ui/gl/gl_image.h" 8 #include "ui/gl/gl_image.h"
9 9
10 #if defined(OS_WIN) || defined(USE_X11) || defined(OS_ANDROID) || \ 10 #if defined(OS_WIN) || defined(USE_X11) || defined(OS_ANDROID) || \
11 defined(USE_OZONE) 11 defined(USE_OZONE)
12 #include <EGL/egl.h> 12 #include <EGL/egl.h>
13 #include <EGL/eglext.h> 13 #include <EGL/eglext.h>
14 #endif 14 #endif
15 15
16 namespace gfx { 16 namespace gfx {
17 17
18 class GL_EXPORT GLImageMemory : public GLImage { 18 class GL_EXPORT GLImageMemory : public GLImage {
19 public: 19 public:
20 GLImageMemory(const gfx::Size& size, unsigned internalformat); 20 GLImageMemory(const gfx::Size& size, unsigned internalformat);
21 21
22 bool Initialize(const unsigned char* memory); 22 bool Initialize(const unsigned char* memory);
23 23
24 // Overridden from GLImage: 24 // Overridden from GLImage:
25 virtual void Destroy() OVERRIDE; 25 virtual void Destroy(bool have_context) OVERRIDE;
26 virtual gfx::Size GetSize() OVERRIDE; 26 virtual gfx::Size GetSize() OVERRIDE;
27 virtual bool BindTexImage(unsigned target) OVERRIDE; 27 virtual bool BindTexImage(unsigned target) OVERRIDE;
28 virtual void ReleaseTexImage(unsigned target) OVERRIDE {} 28 virtual void ReleaseTexImage(unsigned target) OVERRIDE {}
29 virtual void WillUseTexImage() OVERRIDE {} 29 virtual void WillUseTexImage() OVERRIDE {}
30 virtual void DidUseTexImage() OVERRIDE {} 30 virtual void DidUseTexImage() OVERRIDE {}
31 virtual void WillModifyTexImage() OVERRIDE {} 31 virtual void WillModifyTexImage() OVERRIDE {}
32 virtual void DidModifyTexImage() OVERRIDE {} 32 virtual void DidModifyTexImage() OVERRIDE {}
33 33
34 protected: 34 protected:
35 virtual ~GLImageMemory(); 35 virtual ~GLImageMemory();
(...skipping 10 matching lines...) Expand all
46 unsigned egl_texture_id_; 46 unsigned egl_texture_id_;
47 EGLImageKHR egl_image_; 47 EGLImageKHR egl_image_;
48 #endif 48 #endif
49 49
50 DISALLOW_COPY_AND_ASSIGN(GLImageMemory); 50 DISALLOW_COPY_AND_ASSIGN(GLImageMemory);
51 }; 51 };
52 52
53 } // namespace gfx 53 } // namespace gfx
54 54
55 #endif // UI_GL_GL_IMAGE_MEMORY_H_ 55 #endif // UI_GL_GL_IMAGE_MEMORY_H_
OLDNEW
« no previous file with comments | « ui/gl/gl_image_io_surface.cc ('k') | ui/gl/gl_image_memory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698