blob: 2d093e6434786a271f935eb6d0839bc9110f2a59 [file] [log] [blame]
// Copyright 2014 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 <memory>
#include "build/build_config.h"
#include "content/common/content_export.h"
namespace ui {
class ContextFactory;
class ContextFactoryPrivate;
namespace content {
// This class provides the interface for creating the support for the
// cross-process image transport, both for creating the shared surface handle
// (destination surface for the GPU process) and the transport client (logic for
// using that surface as a texture). The factory is a process-wide singleton.
class CONTENT_EXPORT ImageTransportFactory {
virtual ~ImageTransportFactory() {}
// Sets the global transport factory.
static void SetFactory(std::unique_ptr<ImageTransportFactory> factory);
// Terminates the global transport factory.
static void Terminate();
// Gets the factory instance.
static ImageTransportFactory* GetInstance();
// Disable GPU compositing. Will do nothing if GPU compositing is already
// disabled.
virtual void DisableGpuCompositing() = 0;
// Whether gpu compositing is being used or is disabled for software
// compositing. Clients of the compositor should give resources that match
// the appropriate mode.
virtual bool IsGpuCompositingDisabled() = 0;
// Gets the image transport factory as a context factory for the compositor.
virtual ui::ContextFactory* GetContextFactory() = 0;
// Gets the image transport factory as the privileged context factory for the
// compositor. TODO(fsamuel): This interface should eventually go away once
// Mus subsumes this functionality.
virtual ui::ContextFactoryPrivate* GetContextFactoryPrivate() = 0;
} // namespace content