summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorenne <enne@chromium.org>2016-03-24 14:50:58 -0700
committerCommit bot <commit-bot@chromium.org>2016-03-24 21:51:54 +0000
commitae96391ad67ebb128d0e0082bdd9633989fd370b (patch)
tree797edb6d1d2b0fe363b2dbfb6c490ac59a319d25
parent2c19b09a75daf19a0309ae44cd2aa4558ff1115c (diff)
downloadchromium_src-ae96391ad67ebb128d0e0082bdd9633989fd370b.zip
chromium_src-ae96391ad67ebb128d0e0082bdd9633989fd370b.tar.gz
chromium_src-ae96391ad67ebb128d0e0082bdd9633989fd370b.tar.bz2
Remove BlimpUiContextFactory
This removes the override of the ContextFactory and replaces it by just dropping the OnAcceleratedWidgetAvailable call on the floor. This prevents GetSharedBitmap/ResizeDisplay/CreateOutputSurface from being called at all rather than ignoring them when they got called. R=sievers@chromium.org,haibinlu@chromium.org Review URL: https://codereview.chromium.org/1830293003 Cr-Commit-Position: refs/heads/master@{#383156}
-rw-r--r--blimp/engine/BUILD.gn2
-rw-r--r--blimp/engine/DEPS1
-rw-r--r--blimp/engine/app/ui/BUILD.gn2
-rw-r--r--blimp/engine/app/ui/blimp_ui_context_factory.cc86
-rw-r--r--blimp/engine/app/ui/blimp_ui_context_factory.h50
-rw-r--r--blimp/engine/app/ui/blimp_window_tree_host.cc6
-rw-r--r--blimp/engine/app/ui/blimp_window_tree_host.h4
-rw-r--r--blimp/engine/session/blimp_engine_session.cc3
-rw-r--r--blimp/engine/session/blimp_engine_session.h4
9 files changed, 10 insertions, 148 deletions
diff --git a/blimp/engine/BUILD.gn b/blimp/engine/BUILD.gn
index 10b1ee0..0098474 100644
--- a/blimp/engine/BUILD.gn
+++ b/blimp/engine/BUILD.gn
@@ -88,8 +88,6 @@ source_set("app_ui") {
"app/ui/blimp_layout_manager.h",
"app/ui/blimp_screen.cc",
"app/ui/blimp_screen.h",
- "app/ui/blimp_ui_context_factory.cc",
- "app/ui/blimp_ui_context_factory.h",
"app/ui/blimp_window_tree_host.cc",
"app/ui/blimp_window_tree_host.h",
]
diff --git a/blimp/engine/DEPS b/blimp/engine/DEPS
index 9172d10..5c16370 100644
--- a/blimp/engine/DEPS
+++ b/blimp/engine/DEPS
@@ -4,7 +4,6 @@ include_rules = [
"-chrome",
"+components/version_info",
"+components/web_cache/renderer",
- "+content/browser/compositor",
"+content/public",
"+net",
"+third_party/blimp_fonts",
diff --git a/blimp/engine/app/ui/BUILD.gn b/blimp/engine/app/ui/BUILD.gn
index c150133..444b910 100644
--- a/blimp/engine/app/ui/BUILD.gn
+++ b/blimp/engine/app/ui/BUILD.gn
@@ -10,8 +10,6 @@ source_set("ui") {
"blimp_layout_manager.h",
"blimp_screen.cc",
"blimp_screen.h",
- "blimp_ui_context_factory.cc",
- "blimp_ui_context_factory.h",
"blimp_window_tree_host.cc",
"blimp_window_tree_host.h",
]
diff --git a/blimp/engine/app/ui/blimp_ui_context_factory.cc b/blimp/engine/app/ui/blimp_ui_context_factory.cc
deleted file mode 100644
index cd786ed..0000000
--- a/blimp/engine/app/ui/blimp_ui_context_factory.cc
+++ /dev/null
@@ -1,86 +0,0 @@
-// Copyright 2015 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 "blimp/engine/app/ui/blimp_ui_context_factory.h"
-
-#include "cc/output/output_surface.h"
-#include "cc/resources/shared_bitmap_manager.h"
-#include "cc/surfaces/surface_id_allocator.h"
-#include "content/browser/compositor/image_transport_factory.h"
-#include "third_party/khronos/GLES2/gl2.h"
-#include "ui/compositor/reflector.h"
-
-namespace blimp {
-namespace engine {
-
-BlimpUiContextFactory::BlimpUiContextFactory()
- : next_surface_id_namespace_(1u) {}
-
-BlimpUiContextFactory::~BlimpUiContextFactory() {}
-
-void BlimpUiContextFactory::CreateOutputSurface(
- base::WeakPtr<ui::Compositor> compositor) {
-}
-
-scoped_ptr<ui::Reflector> BlimpUiContextFactory::CreateReflector(
- ui::Compositor* mirroed_compositor,
- ui::Layer* mirroring_layer) {
- NOTREACHED();
- return nullptr;
-}
-
-void BlimpUiContextFactory::RemoveReflector(ui::Reflector* reflector) {
- NOTREACHED();
-}
-
-scoped_refptr<cc::ContextProvider>
-BlimpUiContextFactory::SharedMainThreadContextProvider() {
- NOTREACHED();
- return nullptr;
-}
-
-void BlimpUiContextFactory::RemoveCompositor(ui::Compositor* compositor) {
- NOTIMPLEMENTED();
-}
-
-bool BlimpUiContextFactory::DoesCreateTestContexts() {
- return false;
-}
-
-uint32_t BlimpUiContextFactory::GetImageTextureTarget(gfx::BufferFormat format,
- gfx::BufferUsage usage) {
- // No GpuMemoryBuffer support, so just return GL_TEXTURE_2D.
- return GL_TEXTURE_2D;
-}
-
-cc::SharedBitmapManager* BlimpUiContextFactory::GetSharedBitmapManager() {
- return nullptr;
-}
-
-gpu::GpuMemoryBufferManager*
-BlimpUiContextFactory::GetGpuMemoryBufferManager() {
- return nullptr;
-}
-
-cc::TaskGraphRunner* BlimpUiContextFactory::GetTaskGraphRunner() {
- return &task_graph_runner_;
-}
-
-scoped_ptr<cc::SurfaceIdAllocator>
-BlimpUiContextFactory::CreateSurfaceIdAllocator() {
- scoped_ptr<cc::SurfaceIdAllocator> allocator(
- new cc::SurfaceIdAllocator(next_surface_id_namespace_++));
- content::ImageTransportFactory* factory =
- content::ImageTransportFactory::GetInstance();
- if (factory->GetSurfaceManager())
- allocator->RegisterSurfaceIdNamespace(factory->GetSurfaceManager());
- return allocator;
-}
-
-void BlimpUiContextFactory::ResizeDisplay(ui::Compositor* compositor,
- const gfx::Size& size) {
-}
-
-} // namespace engine
-} // namespace blimp
diff --git a/blimp/engine/app/ui/blimp_ui_context_factory.h b/blimp/engine/app/ui/blimp_ui_context_factory.h
deleted file mode 100644
index 4028b54..0000000
--- a/blimp/engine/app/ui/blimp_ui_context_factory.h
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright 2015 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.
-
-#ifndef BLIMP_ENGINE_APP_UI_BLIMP_UI_CONTEXT_FACTORY_H_
-#define BLIMP_ENGINE_APP_UI_BLIMP_UI_CONTEXT_FACTORY_H_
-
-#include <stdint.h>
-
-#include "base/macros.h"
-#include "blimp/common/compositor/blimp_task_graph_runner.h"
-#include "ui/compositor/compositor.h"
-
-namespace blimp {
-namespace engine {
-
-class BlimpUiContextFactory : public ui::ContextFactory {
- public:
- BlimpUiContextFactory();
- ~BlimpUiContextFactory() override;
-
- private:
- // ui::ContextFactory implementation.
- void CreateOutputSurface(base::WeakPtr<ui::Compositor> compositor) override;
- scoped_ptr<ui::Reflector> CreateReflector(
- ui::Compositor* mirrored_compositor,
- ui::Layer* mirroring_layer) override;
- void RemoveReflector(ui::Reflector* reflector) override;
- scoped_refptr<cc::ContextProvider> SharedMainThreadContextProvider() override;
- void RemoveCompositor(ui::Compositor* compositor) override;
- bool DoesCreateTestContexts() override;
- uint32_t GetImageTextureTarget(gfx::BufferFormat format,
- gfx::BufferUsage usage) override;
- cc::SharedBitmapManager* GetSharedBitmapManager() override;
- gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() override;
- cc::TaskGraphRunner* GetTaskGraphRunner() override;
- scoped_ptr<cc::SurfaceIdAllocator> CreateSurfaceIdAllocator() override;
- void ResizeDisplay(ui::Compositor* compositor,
- const gfx::Size& size) override;
-
- uint32_t next_surface_id_namespace_;
- BlimpTaskGraphRunner task_graph_runner_;
-
- DISALLOW_COPY_AND_ASSIGN(BlimpUiContextFactory);
-};
-
-} // namespace engine
-} // namespace blimp
-
-#endif // BLIMP_ENGINE_APP_UI_BLIMP_UI_CONTEXT_FACTORY_H_
diff --git a/blimp/engine/app/ui/blimp_window_tree_host.cc b/blimp/engine/app/ui/blimp_window_tree_host.cc
index 4693757..d5fd0d2 100644
--- a/blimp/engine/app/ui/blimp_window_tree_host.cc
+++ b/blimp/engine/app/ui/blimp_window_tree_host.cc
@@ -15,5 +15,11 @@ BlimpWindowTreeHost::BlimpWindowTreeHost() : aura::WindowTreeHostPlatform() {
BlimpWindowTreeHost::~BlimpWindowTreeHost() {}
+void BlimpWindowTreeHost::OnAcceleratedWidgetAvailable(
+ gfx::AcceleratedWidget widget,
+ float device_pixel_ratio) {
+ // Do nothing to avoid creating an output surface and gpu process.
+}
+
} // namespace engine
} // namespace blimp
diff --git a/blimp/engine/app/ui/blimp_window_tree_host.h b/blimp/engine/app/ui/blimp_window_tree_host.h
index 81791fb..6a48a3e 100644
--- a/blimp/engine/app/ui/blimp_window_tree_host.h
+++ b/blimp/engine/app/ui/blimp_window_tree_host.h
@@ -22,6 +22,10 @@ class BlimpWindowTreeHost : public aura::WindowTreeHostPlatform {
~BlimpWindowTreeHost() override;
private:
+ // aura::WindowTreeHostPlatform overrides.
+ void OnAcceleratedWidgetAvailable(gfx::AcceleratedWidget widget,
+ float device_pixel_ratio) override;
+
DISALLOW_COPY_AND_ASSIGN(BlimpWindowTreeHost);
};
diff --git a/blimp/engine/session/blimp_engine_session.cc b/blimp/engine/session/blimp_engine_session.cc
index 64d0e8f..a1bfbbe 100644
--- a/blimp/engine/session/blimp_engine_session.cc
+++ b/blimp/engine/session/blimp_engine_session.cc
@@ -13,7 +13,6 @@
#include "blimp/engine/app/blimp_engine_config.h"
#include "blimp/engine/app/ui/blimp_layout_manager.h"
#include "blimp/engine/app/ui/blimp_screen.h"
-#include "blimp/engine/app/ui/blimp_ui_context_factory.h"
#include "blimp/engine/app/ui/blimp_window_tree_host.h"
#include "blimp/engine/common/blimp_browser_context.h"
#include "blimp/net/blimp_connection.h"
@@ -207,8 +206,6 @@ void BlimpEngineSession::Initialize() {
DCHECK(!gfx::Screen::GetScreen());
gfx::Screen::SetScreenInstance(screen_.get());
- context_factory_.reset(new BlimpUiContextFactory());
- aura::Env::GetInstance()->set_context_factory(context_factory_.get());
window_tree_host_.reset(new BlimpWindowTreeHost());
screen_->set_window_tree_host(window_tree_host_.get());
diff --git a/blimp/engine/session/blimp_engine_session.h b/blimp/engine/session/blimp_engine_session.h
index 1298c77..75bde2e 100644
--- a/blimp/engine/session/blimp_engine_session.h
+++ b/blimp/engine/session/blimp_engine_session.h
@@ -61,7 +61,6 @@ class BlimpBrowserContext;
class BlimpEngineConfig;
class BlimpFocusClient;
class BlimpScreen;
-class BlimpUiContextFactory;
class BlimpWindowTreeHost;
class EngineNetworkComponents;
@@ -161,9 +160,6 @@ class BlimpEngineSession
// Presents the client's single screen.
scoped_ptr<BlimpScreen> screen_;
- // Context factory for compositor.
- scoped_ptr<BlimpUiContextFactory> context_factory_;
-
// Represents the (currently single) browser window into which tab(s) will
// be rendered.
scoped_ptr<BlimpWindowTreeHost> window_tree_host_;