summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorenne <enne@chromium.org>2016-03-24 10:58:02 -0700
committerCommit bot <commit-bot@chromium.org>2016-03-24 17:59:27 +0000
commitc9295554c6764463c506aca4b81c0ff95a851f86 (patch)
treef2327289102d27dda78ae5164be46a9c3336d84a
parent3da856f7687034c5424aa2d1aa70517b3ed6eb51 (diff)
downloadchromium_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/DEPS1
-rw-r--r--blimp/engine/app/ui/blimp_ui_context_factory.cc8
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,