2015-01-01 17:51:56 +01:00
|
|
|
diff --git content/browser/compositor/gpu_process_transport_factory.cc content/browser/compositor/gpu_process_transport_factory.cc
|
2015-03-04 02:00:13 +01:00
|
|
|
index 3658c25..74acc61 100644
|
2015-01-01 17:51:56 +01:00
|
|
|
--- content/browser/compositor/gpu_process_transport_factory.cc
|
|
|
|
+++ content/browser/compositor/gpu_process_transport_factory.cc
|
2015-03-04 02:00:13 +01:00
|
|
|
@@ -98,6 +98,13 @@ GpuProcessTransportFactory::CreateOffscreenCommandBufferContext() {
|
2015-01-01 17:51:56 +01:00
|
|
|
|
|
|
|
scoped_ptr<cc::SoftwareOutputDevice> CreateSoftwareOutputDevice(
|
|
|
|
ui::Compositor* compositor) {
|
|
|
|
+ if (compositor->delegate()) {
|
|
|
|
+ scoped_ptr<cc::SoftwareOutputDevice> output_device =
|
|
|
|
+ compositor->delegate()->CreateSoftwareOutputDevice(compositor);
|
|
|
|
+ if (output_device.get())
|
|
|
|
+ return output_device;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
#if defined(OS_WIN)
|
|
|
|
return scoped_ptr<cc::SoftwareOutputDevice>(new SoftwareOutputDeviceWin(
|
|
|
|
compositor));
|
|
|
|
diff --git ui/compositor/compositor.h ui/compositor/compositor.h
|
2015-03-04 02:00:13 +01:00
|
|
|
index 47d4cd0..793bbe3 100644
|
2015-01-01 17:51:56 +01:00
|
|
|
--- ui/compositor/compositor.h
|
|
|
|
+++ ui/compositor/compositor.h
|
|
|
|
@@ -13,6 +13,7 @@
|
|
|
|
#include "base/observer_list.h"
|
|
|
|
#include "base/single_thread_task_runner.h"
|
|
|
|
#include "base/time/time.h"
|
|
|
|
+#include "cc/output/software_output_device.h"
|
|
|
|
#include "cc/surfaces/surface_sequence.h"
|
|
|
|
#include "cc/trees/layer_tree_host_client.h"
|
|
|
|
#include "cc/trees/layer_tree_host_single_thread_client.h"
|
2015-03-04 02:00:13 +01:00
|
|
|
@@ -131,6 +132,17 @@ class COMPOSITOR_EXPORT CompositorLock
|
2015-01-01 17:51:56 +01:00
|
|
|
DISALLOW_COPY_AND_ASSIGN(CompositorLock);
|
|
|
|
};
|
|
|
|
|
|
|
|
+class COMPOSITOR_EXPORT CompositorDelegate {
|
|
|
|
+ public:
|
|
|
|
+ virtual scoped_ptr<cc::SoftwareOutputDevice> CreateSoftwareOutputDevice(
|
|
|
|
+ ui::Compositor* compositor) {
|
|
|
|
+ return scoped_ptr<cc::SoftwareOutputDevice>();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ protected:
|
|
|
|
+ virtual ~CompositorDelegate() {}
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
// Compositor object to take care of GPU painting.
|
|
|
|
// A Browser compositor object is responsible for generating the final
|
|
|
|
// displayable form of pixels comprising a single widget's contents. It draws an
|
2015-03-04 02:00:13 +01:00
|
|
|
@@ -152,6 +164,9 @@ class COMPOSITOR_EXPORT Compositor
|
2015-01-01 17:51:56 +01:00
|
|
|
// Schedules a redraw of the layer tree associated with this compositor.
|
|
|
|
void ScheduleDraw();
|
|
|
|
|
|
|
|
+ CompositorDelegate* delegate() const { return delegate_; }
|
|
|
|
+ void SetDelegate(CompositorDelegate* delegate) { delegate_ = delegate; }
|
|
|
|
+
|
|
|
|
// Sets the root of the layer tree drawn by this Compositor. The root layer
|
|
|
|
// must have no parent. The compositor's root layer is reset if the root layer
|
|
|
|
// is destroyed. NULL can be passed to reset the root layer, in which case the
|
2015-03-04 02:00:13 +01:00
|
|
|
@@ -297,6 +312,8 @@ class COMPOSITOR_EXPORT Compositor
|
2015-01-01 17:51:56 +01:00
|
|
|
|
|
|
|
ui::ContextFactory* context_factory_;
|
|
|
|
|
|
|
|
+ CompositorDelegate* delegate_ = nullptr;
|
|
|
|
+
|
|
|
|
// The root of the Layer tree drawn by this compositor.
|
|
|
|
Layer* root_layer_;
|
|
|
|
|