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

Side by Side Diff: content/browser/renderer_host/accelerated_surface_container_linux_cc.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_cc.h" 9 #include "ui/gfx/compositor/compositor_cc.h"
10 #include "ui/gfx/gl/gl_bindings.h" 10 #include "ui/gfx/gl/gl_bindings.h"
(...skipping 19 matching lines...) Expand all
30 glDeleteTextures(1, &texture_id_); 30 glDeleteTextures(1, &texture_id_);
31 } 31 }
32 32
33 if (image_transport_client_.get()) 33 if (image_transport_client_.get())
34 image_transport_client_->Release(); 34 image_transport_client_->Release();
35 } 35 }
36 36
37 virtual void AddRef() { ui::TextureCC::AddRef(); } 37 virtual void AddRef() { ui::TextureCC::AddRef(); }
38 virtual void Release() { ui::TextureCC::Release(); } 38 virtual void Release() { ui::TextureCC::Release(); }
39 39
40 virtual bool Initialize(uint64* surface_id) OVERRIDE { 40 virtual bool Initialize(uint64* surface_handle) OVERRIDE {
41 ui::SharedResourcesCC* instance = ui::SharedResourcesCC::GetInstance(); 41 ui::SharedResourcesCC* instance = ui::SharedResourcesCC::GetInstance();
42 DCHECK(instance); 42 DCHECK(instance);
43 image_transport_client_.reset( 43 image_transport_client_.reset(
44 ImageTransportClient::Create(instance, size_)); 44 ImageTransportClient::Create(instance, size_));
45 if (!image_transport_client_.get()) 45 if (!image_transport_client_.get())
46 return false; 46 return false;
47 47
48 texture_id_ = image_transport_client_->Initialize(surface_id); 48 texture_id_ = image_transport_client_->Initialize(surface_handle);
49 if (!texture_id_) { 49 if (!texture_id_) {
50 image_transport_client_.reset(); 50 image_transport_client_.reset();
51 return false; 51 return false;
52 } 52 }
53 flipped_ = image_transport_client_->Flipped(); 53 flipped_ = image_transport_client_->Flipped();
54 return true; 54 return true;
55 } 55 }
56 56
57 virtual const gfx::Size& GetSize() { 57 virtual const gfx::Size& GetSize() {
58 return ui::TextureCC::size(); 58 return ui::TextureCC::size();
(...skipping 23 matching lines...) Expand all
82 DISALLOW_COPY_AND_ASSIGN(AcceleratedSurfaceContainerLinuxCC); 82 DISALLOW_COPY_AND_ASSIGN(AcceleratedSurfaceContainerLinuxCC);
83 }; 83 };
84 84
85 } // namespace 85 } // namespace
86 86
87 // static 87 // static
88 AcceleratedSurfaceContainerLinux* 88 AcceleratedSurfaceContainerLinux*
89 AcceleratedSurfaceContainerLinux::Create(const gfx::Size& size) { 89 AcceleratedSurfaceContainerLinux::Create(const gfx::Size& size) {
90 return new AcceleratedSurfaceContainerLinuxCC(size); 90 return new AcceleratedSurfaceContainerLinuxCC(size);
91 } 91 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698