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

Side by Side Diff: ui/ozone/demo/surfaceless_gl_renderer.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/test/gl_image_test_template.h ('k') | ui/ozone/gl/gl_image_ozone_native_pixmap.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/ozone/demo/surfaceless_gl_renderer.h" 5 #include "ui/ozone/demo/surfaceless_gl_renderer.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 12 matching lines...) Expand all
23 SurfacelessGlRenderer::BufferWrapper::BufferWrapper() { 23 SurfacelessGlRenderer::BufferWrapper::BufferWrapper() {
24 } 24 }
25 25
26 SurfacelessGlRenderer::BufferWrapper::~BufferWrapper() { 26 SurfacelessGlRenderer::BufferWrapper::~BufferWrapper() {
27 if (gl_fb_) 27 if (gl_fb_)
28 glDeleteFramebuffersEXT(1, &gl_fb_); 28 glDeleteFramebuffersEXT(1, &gl_fb_);
29 29
30 if (gl_tex_) { 30 if (gl_tex_) {
31 image_->ReleaseTexImage(GL_TEXTURE_2D); 31 image_->ReleaseTexImage(GL_TEXTURE_2D);
32 glDeleteTextures(1, &gl_tex_); 32 glDeleteTextures(1, &gl_tex_);
33 image_->Destroy(true);
34 } 33 }
35 } 34 }
36 35
37 bool SurfacelessGlRenderer::BufferWrapper::Initialize( 36 bool SurfacelessGlRenderer::BufferWrapper::Initialize(
38 gfx::AcceleratedWidget widget, 37 gfx::AcceleratedWidget widget,
39 const gfx::Size& size) { 38 const gfx::Size& size) {
40 glGenFramebuffersEXT(1, &gl_fb_); 39 glGenFramebuffersEXT(1, &gl_fb_);
41 glGenTextures(1, &gl_tex_); 40 glGenTextures(1, &gl_tex_);
42 41
43 gfx::BufferFormat format = ui::DisplaySnapshot::PrimaryFormat(); 42 gfx::BufferFormat format = ui::DisplaySnapshot::PrimaryFormat();
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 case gfx::SwapResult::SWAP_ACK: 133 case gfx::SwapResult::SWAP_ACK:
135 GlRenderer::PostRenderFrameTask(result); 134 GlRenderer::PostRenderFrameTask(result);
136 break; 135 break;
137 case gfx::SwapResult::SWAP_FAILED: 136 case gfx::SwapResult::SWAP_FAILED:
138 LOG(FATAL) << "Failed to swap buffers"; 137 LOG(FATAL) << "Failed to swap buffers";
139 break; 138 break;
140 } 139 }
141 } 140 }
142 141
143 } // namespace ui 142 } // namespace ui
OLDNEW
« no previous file with comments | « ui/gl/test/gl_image_test_template.h ('k') | ui/ozone/gl/gl_image_ozone_native_pixmap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698