diff options
author | enne <enne@chromium.org> | 2016-03-24 10:58:02 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-24 17:59:27 +0000 |
commit | c9295554c6764463c506aca4b81c0ff95a851f86 (patch) | |
tree | f2327289102d27dda78ae5164be46a9c3336d84a | |
parent | 3da856f7687034c5424aa2d1aa70517b3ed6eb51 (diff) | |
download | chromium_src-c9295554c6764463c506aca4b81c0ff95a851f86.zip chromium_src-c9295554c6764463c506aca4b81c0ff95a851f86.tar.gz chromium_src-c9295554c6764463c506aca4b81c0ff95a851f86.tar.bz2 |
Register surface namespace in BlimpUiContextFactory
The BlimpUiContextFactory handles creating surface id allocators, so
also needs to register them as being valid surfaces with the surface
manager like GpuProcessTransportFactory does.
In order to do this, the surface manager and surface id allocator
logic from content/browser/compositor/surface_utils is hoisted up
into content/public/browser so that BlimpUiContextFactory can get
at the global SurfaceManager.
This is a band-aid fix, as it's possible for existing code to create
a surface using the GpuProcessTransportFactory::GetContextFactory
(which is the GpuProcessTransportFactory itself) instead of the
ui::aura::Env::GetInstance()->GetContextFactory() which is overridden
by Blimp and is the BlimpUiContextmanager. This needs to be cleaned
up separately.
BUG=595497
CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_site_isolation
Review URL: https://codereview.chromium.org/1808313002
Cr-Commit-Position: refs/heads/master@{#383096}
-rw-r--r-- | blimp/engine/DEPS | 1 | ||||
-rw-r--r-- | blimp/engine/app/ui/blimp_ui_context_factory.cc | 8 |
2 files changed, 8 insertions, 1 deletions
diff --git a/blimp/engine/DEPS b/blimp/engine/DEPS index 5c16370..9172d10 100644 --- a/blimp/engine/DEPS +++ b/blimp/engine/DEPS @@ -4,6 +4,7 @@ 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/blimp_ui_context_factory.cc b/blimp/engine/app/ui/blimp_ui_context_factory.cc index b9246d0..cd786ed 100644 --- a/blimp/engine/app/ui/blimp_ui_context_factory.cc +++ b/blimp/engine/app/ui/blimp_ui_context_factory.cc @@ -7,6 +7,7 @@ #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" @@ -68,8 +69,13 @@ cc::TaskGraphRunner* BlimpUiContextFactory::GetTaskGraphRunner() { scoped_ptr<cc::SurfaceIdAllocator> BlimpUiContextFactory::CreateSurfaceIdAllocator() { - return make_scoped_ptr( + 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, |