diff options
Diffstat (limited to 'content/public/renderer')
4 files changed, 78 insertions, 0 deletions
diff --git a/content/public/renderer/android/OWNERS b/content/public/renderer/android/OWNERS new file mode 100644 index 0000000..cff1ac9 --- /dev/null +++ b/content/public/renderer/android/OWNERS @@ -0,0 +1,6 @@ +# While the SynchronousCompositor API is in active development include +# all the following owners in any changes under this path. + +jamesr@chromium.org +joth@chromium.org +mkosiba@chromium.org diff --git a/content/public/renderer/android/synchronous_compositor.h b/content/public/renderer/android/synchronous_compositor.h new file mode 100644 index 0000000..f0c380d --- /dev/null +++ b/content/public/renderer/android/synchronous_compositor.h @@ -0,0 +1,35 @@ +// Copyright (c) 2013 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 CONTENT_PUBLIC_RENDERER_ANDROID_SYNCHRONOUS_COMPOSTIOR_ +#define CONTENT_PUBLIC_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_ + +class SkCanvas; + +namespace content { + +class SynchronousCompositorClient; + +// Interface for embedders that which to direct compositing operations +// synchronously under their own control. Only meaningful when the +// kEnableSyncrhonousRendererCompositor flag is specified. +class SynchronousCompositor { + public: + // Allows changing or resetting the client to NULL (this must be used if + // the client is being deleted prior to the DidDestroyCompositor() call + // being received by the client). Ownership of |client| remains with + // the caller. + virtual void SetClient(SynchronousCompositorClient* client) = 0; + + // "On demand" SW draw, into the supplied canvas (observing the transform + // and clip set there-in). + virtual bool DemandDrawSw(SkCanvas* canvas) = 0; + + protected: + virtual ~SynchronousCompositor() {} +}; + +} // namespace content + +#endif // CONTENT_PUBLIC_RENDERER_ANDROID_SYNCHRONOUS_COMPOSTIOR_ diff --git a/content/public/renderer/android/synchronous_compositor_client.h b/content/public/renderer/android/synchronous_compositor_client.h new file mode 100644 index 0000000..dcbe09a --- /dev/null +++ b/content/public/renderer/android/synchronous_compositor_client.h @@ -0,0 +1,28 @@ +// Copyright (c) 2013 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 CONTENT_PUBLIC_RENDERER_ANDROID_SYNCHRONOUS_COMPOSTIOR_CLIENT_H_ +#define CONTENT_PUBLIC_RENDERER_ANDROID_SYNCRHONOUS_COMPOSITOR_CLIENT_H_ + +namespace content { + +class SynchronousCompositor; + +class SynchronousCompositorClient { + public: + // Indication to the client that |compositor| is going out of scope, and + // must not be accessed within or after this call. + // NOTE if the client goes away before the compositor it must call + // SynchronousCompositor::SetClient(NULL) to release the back pointer. + virtual void DidDestroyCompositor(SynchronousCompositor* compositor) = 0; + + // TODO(joth): Add scroll getters and setters, and invalidations. + + protected: + virtual ~SynchronousCompositorClient() {} +}; + +} // namespace content + +#endif // CONTENT_PUBLIC_RENDERER_ANDROID_SYNCHRONOUS_COMPOSTIOR_CLIENT_H_ diff --git a/content/public/renderer/content_renderer_client.h b/content/public/renderer/content_renderer_client.h index 653d38c..84b6d58 100644 --- a/content/public/renderer/content_renderer_client.h +++ b/content/public/renderer/content_renderer_client.h @@ -59,6 +59,7 @@ class WebMediaPlayerParams; namespace content { class RenderView; +class SynchronousCompositor; // Embedder API for participating in renderer logic. class CONTENT_EXPORT ContentRendererClient { @@ -234,6 +235,14 @@ class CONTENT_EXPORT ContentRendererClient { // RenderThreadImpl. If NULL, then a new thread will be created. virtual base::MessageLoop* OverrideCompositorMessageLoop() const; + // Called when a render view's compositor instance is created, when the + // kEnableSynchronousRendererCompositor flag is used. + // NOTE this is called on the Compositor thread: the embedder must + // implement OverrideCompositorMessageLoop() when using this interface. + virtual void DidCreateSynchronousCompositor( + int render_view_id, + SynchronousCompositor* compositor) {} + // Allow the embedder to disable input event filtering by the compositor. virtual bool ShouldCreateCompositorInputHandler() const; }; |