| OLD | NEW |
| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 | 47 |
| 48 texture_id_ = image_transport_client_->Initialize(surface_id); | 48 texture_id_ = image_transport_client_->Initialize(surface_id); |
| 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() { |
| 58 return ui::TextureCC::size(); |
| 59 } |
| 60 |
| 57 // TextureCC implementation | 61 // TextureCC implementation |
| 58 virtual void Update() OVERRIDE { | 62 virtual void Update() OVERRIDE { |
| 59 ui::SharedResourcesCC* instance = ui::SharedResourcesCC::GetInstance(); | 63 ui::SharedResourcesCC* instance = ui::SharedResourcesCC::GetInstance(); |
| 60 DCHECK(instance); | 64 DCHECK(instance); |
| 61 scoped_ptr<gfx::ScopedMakeCurrent> bind(instance->GetScopedMakeCurrent()); | 65 scoped_ptr<gfx::ScopedMakeCurrent> bind(instance->GetScopedMakeCurrent()); |
| 62 if (acquired_) | 66 if (acquired_) |
| 63 image_transport_client_->Release(); | 67 image_transport_client_->Release(); |
| 64 else | 68 else |
| 65 acquired_ = true; | 69 acquired_ = true; |
| 66 image_transport_client_->Acquire(); | 70 image_transport_client_->Acquire(); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 78 DISALLOW_COPY_AND_ASSIGN(AcceleratedSurfaceContainerLinuxCC); | 82 DISALLOW_COPY_AND_ASSIGN(AcceleratedSurfaceContainerLinuxCC); |
| 79 }; | 83 }; |
| 80 | 84 |
| 81 } // namespace | 85 } // namespace |
| 82 | 86 |
| 83 // static | 87 // static |
| 84 AcceleratedSurfaceContainerLinux* | 88 AcceleratedSurfaceContainerLinux* |
| 85 AcceleratedSurfaceContainerLinux::Create(const gfx::Size& size) { | 89 AcceleratedSurfaceContainerLinux::Create(const gfx::Size& size) { |
| 86 return new AcceleratedSurfaceContainerLinuxCC(size); | 90 return new AcceleratedSurfaceContainerLinuxCC(size); |
| 87 } | 91 } |
| OLD | NEW |