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

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

Issue 9194005: gpu: reference target surfaces through a globally unique surface id. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix more tests Created 8 years, 11 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 | Annotate | Revision Log
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_gl.h" 9 #include "ui/gfx/compositor/compositor_gl.h"
10 #include "ui/gfx/rect.h" 10 #include "ui/gfx/rect.h"
11 #include "ui/gfx/transform.h" 11 #include "ui/gfx/transform.h"
12 12
13 namespace { 13 namespace {
14 14
15 class AcceleratedSurfaceContainerLinuxGL 15 class AcceleratedSurfaceContainerLinuxGL
16 : public AcceleratedSurfaceContainerLinux, public ui::TextureGL { 16 : public AcceleratedSurfaceContainerLinux, public ui::TextureGL {
17 public: 17 public:
18 explicit AcceleratedSurfaceContainerLinuxGL(const gfx::Size& size) 18 explicit AcceleratedSurfaceContainerLinuxGL(const gfx::Size& size)
19 : ui::TextureGL(size) { 19 : ui::TextureGL(size) {
20 } 20 }
21 21
22 virtual ~AcceleratedSurfaceContainerLinuxGL() { } 22 virtual ~AcceleratedSurfaceContainerLinuxGL() { }
23 virtual void AddRef() { ui::TextureGL::AddRef(); } 23 virtual void AddRef() { ui::TextureGL::AddRef(); }
24 virtual void Release() { ui::TextureGL::Release(); } 24 virtual void Release() { ui::TextureGL::Release(); }
25 25
26 virtual bool Initialize(uint64* surface_id) OVERRIDE { 26 virtual bool Initialize(uint64* surface_handle) OVERRIDE {
27 ui::SharedResourcesGL* instance = ui::SharedResourcesGL::GetInstance(); 27 ui::SharedResourcesGL* instance = ui::SharedResourcesGL::GetInstance();
28 DCHECK(instance); 28 DCHECK(instance);
29 image_transport_client_.reset( 29 image_transport_client_.reset(
30 ImageTransportClient::Create(instance, size_)); 30 ImageTransportClient::Create(instance, size_));
31 if (!image_transport_client_.get()) 31 if (!image_transport_client_.get())
32 return false; 32 return false;
33 33
34 texture_id_ = image_transport_client_->Initialize(surface_id); 34 texture_id_ = image_transport_client_->Initialize(surface_handle);
35 if (!texture_id_) { 35 if (!texture_id_) {
36 image_transport_client_.reset(); 36 image_transport_client_.reset();
37 return false; 37 return false;
38 } 38 }
39 return true; 39 return true;
40 } 40 }
41 41
42 virtual const gfx::Size& GetSize() { 42 virtual const gfx::Size& GetSize() {
43 return ui::TextureGL::size(); 43 return ui::TextureGL::size();
44 } 44 }
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 DISALLOW_COPY_AND_ASSIGN(AcceleratedSurfaceContainerLinuxGL); 77 DISALLOW_COPY_AND_ASSIGN(AcceleratedSurfaceContainerLinuxGL);
78 }; 78 };
79 79
80 } // namespace 80 } // namespace
81 81
82 // static 82 // static
83 AcceleratedSurfaceContainerLinux* 83 AcceleratedSurfaceContainerLinux*
84 AcceleratedSurfaceContainerLinux::Create(const gfx::Size& size) { 84 AcceleratedSurfaceContainerLinux::Create(const gfx::Size& size) {
85 return new AcceleratedSurfaceContainerLinuxGL(size); 85 return new AcceleratedSurfaceContainerLinuxGL(size);
86 } 86 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698