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

Unified Diff: content/browser/renderer_host/accelerated_surface_container_linux_cc.cc

Issue 9297041: Merge Compositor and CompositorCC (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/accelerated_surface_container_linux_cc.cc
diff --git a/content/browser/renderer_host/accelerated_surface_container_linux_cc.cc b/content/browser/renderer_host/accelerated_surface_container_linux_cc.cc
deleted file mode 100644
index e6936dee99caa730d38b653bc7b8847d8cf2e94e..0000000000000000000000000000000000000000
--- a/content/browser/renderer_host/accelerated_surface_container_linux_cc.cc
+++ /dev/null
@@ -1,91 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "content/browser/renderer_host/accelerated_surface_container_linux.h"
-
-#include "base/memory/scoped_ptr.h"
-#include "content/browser/renderer_host/image_transport_client.h"
-#include "ui/gfx/compositor/compositor_cc.h"
-#include "ui/gfx/gl/gl_bindings.h"
-#include "ui/gfx/gl/scoped_make_current.h"
-#include "ui/gfx/rect.h"
-#include "ui/gfx/transform.h"
-
-namespace {
-
-class AcceleratedSurfaceContainerLinuxCC
- : public AcceleratedSurfaceContainerLinux, public ui::TextureCC {
- public:
- explicit AcceleratedSurfaceContainerLinuxCC(const gfx::Size& size)
- : acquired_(false) {
- size_ = size;
- }
-
- virtual ~AcceleratedSurfaceContainerLinuxCC() {
- if (texture_id_) {
- ui::SharedResourcesCC* instance = ui::SharedResourcesCC::GetInstance();
- DCHECK(instance);
- scoped_ptr<gfx::ScopedMakeCurrent> bind(instance->GetScopedMakeCurrent());
- glDeleteTextures(1, &texture_id_);
- }
-
- if (image_transport_client_.get())
- image_transport_client_->Release();
- }
-
- virtual void AddRef() { ui::TextureCC::AddRef(); }
- virtual void Release() { ui::TextureCC::Release(); }
-
- virtual bool Initialize(uint64* surface_handle) OVERRIDE {
- ui::SharedResourcesCC* instance = ui::SharedResourcesCC::GetInstance();
- DCHECK(instance);
- image_transport_client_.reset(
- ImageTransportClient::Create(instance, size_));
- if (!image_transport_client_.get())
- return false;
-
- texture_id_ = image_transport_client_->Initialize(surface_handle);
- if (!texture_id_) {
- image_transport_client_.reset();
- return false;
- }
- flipped_ = image_transport_client_->Flipped();
- return true;
- }
-
- virtual const gfx::Size& GetSize() {
- return ui::TextureCC::size();
- }
-
- // TextureCC implementation
- virtual void Update() OVERRIDE {
- ui::SharedResourcesCC* instance = ui::SharedResourcesCC::GetInstance();
- DCHECK(instance);
- scoped_ptr<gfx::ScopedMakeCurrent> bind(instance->GetScopedMakeCurrent());
- if (acquired_)
- image_transport_client_->Release();
- else
- acquired_ = true;
- image_transport_client_->Acquire();
- }
-
- virtual TransportDIB::Handle Handle() const {
- return image_transport_client_->Handle();
- }
-
- virtual ui::Texture* GetTexture() { return this; }
-
- private:
- scoped_ptr<ImageTransportClient> image_transport_client_;
- bool acquired_;
- DISALLOW_COPY_AND_ASSIGN(AcceleratedSurfaceContainerLinuxCC);
-};
-
-} // namespace
-
-// static
-AcceleratedSurfaceContainerLinux*
-AcceleratedSurfaceContainerLinux::Create(const gfx::Size& size) {
- return new AcceleratedSurfaceContainerLinuxCC(size);
-}

Powered by Google App Engine
This is Rietveld 408576698