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

Side by Side Diff: content/browser/renderer_host/accelerated_surface_container_linux_cc.cc

Issue 8523016: aura/cc: Fix GPU leak on resize. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "content/browser/renderer_host/accelerated_surface_container_linux.h" 5 #include "content/browser/renderer_host/accelerated_surface_container_linux.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "content/browser/renderer_host/image_transport_client.h" 8 #include "content/browser/renderer_host/image_transport_client.h"
9 #include "ui/gfx/compositor/compositor_cc.h" 9 #include "ui/gfx/compositor/compositor_cc.h"
10 #include "ui/gfx/gl/gl_bindings.h"
10 #include "ui/gfx/rect.h" 11 #include "ui/gfx/rect.h"
11 #include "ui/gfx/transform.h" 12 #include "ui/gfx/transform.h"
12 13
13 namespace { 14 namespace {
14 15
15 class AcceleratedSurfaceContainerLinuxCC 16 class AcceleratedSurfaceContainerLinuxCC
16 : public AcceleratedSurfaceContainerLinux, public ui::TextureCC { 17 : public AcceleratedSurfaceContainerLinux, public ui::TextureCC {
17 public: 18 public:
18 explicit AcceleratedSurfaceContainerLinuxCC(const gfx::Size& size) 19 explicit AcceleratedSurfaceContainerLinuxCC(const gfx::Size& size)
19 : size_(size), 20 : size_(size),
20 acquired_(false) { 21 acquired_(false) {
21 } 22 }
22 23
23 virtual ~AcceleratedSurfaceContainerLinuxCC() { 24 virtual ~AcceleratedSurfaceContainerLinuxCC() {
25 if (texture_id_) {
26 ui::SharedResourcesCC* instance = ui::SharedResourcesCC::GetInstance();
27 DCHECK(instance);
28 instance->MakeSharedContextCurrent();
29 glDeleteTextures(1, &texture_id_);
30 }
31
24 if (image_transport_client_.get()) 32 if (image_transport_client_.get())
25 image_transport_client_->Release(); 33 image_transport_client_->Release();
26 } 34 }
27 35
28 virtual void AddRef() { ui::TextureCC::AddRef(); } 36 virtual void AddRef() { ui::TextureCC::AddRef(); }
29 virtual void Release() { ui::TextureCC::Release(); } 37 virtual void Release() { ui::TextureCC::Release(); }
30 38
31 virtual bool Initialize(uint64* surface_id) OVERRIDE { 39 virtual bool Initialize(uint64* surface_id) OVERRIDE {
32 ui::SharedResourcesCC* instance = ui::SharedResourcesCC::GetInstance(); 40 ui::SharedResourcesCC* instance = ui::SharedResourcesCC::GetInstance();
33 DCHECK(instance); 41 DCHECK(instance);
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 DISALLOW_COPY_AND_ASSIGN(AcceleratedSurfaceContainerLinuxCC); 78 DISALLOW_COPY_AND_ASSIGN(AcceleratedSurfaceContainerLinuxCC);
71 }; 79 };
72 80
73 } // namespace 81 } // namespace
74 82
75 // static 83 // static
76 AcceleratedSurfaceContainerLinux* 84 AcceleratedSurfaceContainerLinux*
77 AcceleratedSurfaceContainerLinux::Create(const gfx::Size& size) { 85 AcceleratedSurfaceContainerLinux::Create(const gfx::Size& size) {
78 return new AcceleratedSurfaceContainerLinuxCC(size); 86 return new AcceleratedSurfaceContainerLinuxCC(size);
79 } 87 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698