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

Side by Side Diff: ui/gl/gl_image_surface_texture.cc

Issue 2449993005: Remove GLImage::Destroy(). (Closed)
Patch Set: One more Destroy() call on Mac. Created 4 years, 1 month 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_surface_texture.h ('k') | ui/gl/test/gl_image_test_template.h » ('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 #include "ui/gl/gl_image_surface_texture.h" 5 #include "ui/gl/gl_image_surface_texture.h"
6 6
7 #include "base/trace_event/trace_event.h" 7 #include "base/trace_event/trace_event.h"
8 #include "ui/gl/android/surface_texture.h" 8 #include "ui/gl/android/surface_texture.h"
9 9
10 namespace gl { 10 namespace gl {
11 11
12 GLImageSurfaceTexture::GLImageSurfaceTexture(const gfx::Size& size) 12 GLImageSurfaceTexture::GLImageSurfaceTexture(const gfx::Size& size)
13 : size_(size), texture_id_(0) {} 13 : size_(size), texture_id_(0) {}
14 14
15 GLImageSurfaceTexture::~GLImageSurfaceTexture() { 15 GLImageSurfaceTexture::~GLImageSurfaceTexture() {
16 DCHECK(thread_checker_.CalledOnValidThread()); 16 DCHECK(thread_checker_.CalledOnValidThread());
17 DCHECK(!surface_texture_.get());
18 DCHECK_EQ(0, texture_id_);
19 } 17 }
20 18
21 bool GLImageSurfaceTexture::Initialize(SurfaceTexture* surface_texture) { 19 bool GLImageSurfaceTexture::Initialize(SurfaceTexture* surface_texture) {
22 DCHECK(thread_checker_.CalledOnValidThread()); 20 DCHECK(thread_checker_.CalledOnValidThread());
23 DCHECK(!surface_texture_.get()); 21 DCHECK(!surface_texture_.get());
24 surface_texture_ = surface_texture; 22 surface_texture_ = surface_texture;
25 return true; 23 return true;
26 } 24 }
27 25
28 void GLImageSurfaceTexture::Destroy(bool have_context) {
29 DCHECK(thread_checker_.CalledOnValidThread());
30 surface_texture_ = NULL;
31 texture_id_ = 0;
32 }
33
34 gfx::Size GLImageSurfaceTexture::GetSize() { 26 gfx::Size GLImageSurfaceTexture::GetSize() {
35 return size_; 27 return size_;
36 } 28 }
37 29
38 unsigned GLImageSurfaceTexture::GetInternalFormat() { return GL_RGBA; } 30 unsigned GLImageSurfaceTexture::GetInternalFormat() { return GL_RGBA; }
39 31
40 bool GLImageSurfaceTexture::BindTexImage(unsigned target) { 32 bool GLImageSurfaceTexture::BindTexImage(unsigned target) {
41 TRACE_EVENT0("gpu", "GLImageSurfaceTexture::BindTexImage"); 33 TRACE_EVENT0("gpu", "GLImageSurfaceTexture::BindTexImage");
42 DCHECK(thread_checker_.CalledOnValidThread()); 34 DCHECK(thread_checker_.CalledOnValidThread());
43 35
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 } 91 }
100 92
101 void GLImageSurfaceTexture::OnMemoryDump( 93 void GLImageSurfaceTexture::OnMemoryDump(
102 base::trace_event::ProcessMemoryDump* pmd, 94 base::trace_event::ProcessMemoryDump* pmd,
103 uint64_t process_tracing_id, 95 uint64_t process_tracing_id,
104 const std::string& dump_name) { 96 const std::string& dump_name) {
105 // TODO(ericrk): Add OnMemoryDump for GLImages. crbug.com/514914 97 // TODO(ericrk): Add OnMemoryDump for GLImages. crbug.com/514914
106 } 98 }
107 99
108 } // namespace gl 100 } // namespace gl
OLDNEW
« no previous file with comments | « ui/gl/gl_image_surface_texture.h ('k') | ui/gl/test/gl_image_test_template.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698