synchronous_compositor_client.h revision 7d4cd473f85ac64c3747c96c277f9e506a0d2246
1// Copyright 2013 The Chromium Authors. All rights reserved. 2// Use of this source code is governed by a BSD-style license that can be 3// found in the LICENSE file. 4 5#ifndef CONTENT_PUBLIC_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_CLIENT_H_ 6#define CONTENT_PUBLIC_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_CLIENT_H_ 7 8#include "base/basictypes.h" 9#include "ui/gfx/vector2d_f.h" 10 11namespace content { 12 13class SynchronousCompositor; 14 15class SynchronousCompositorClient { 16 public: 17 // Indication to the client that |compositor| is now initialized on the 18 // compositor thread, and open for business. 19 virtual void DidInitializeCompositor(SynchronousCompositor* compositor) = 0; 20 21 // Indication to the client that |compositor| is going out of scope, and 22 // must not be accessed within or after this call. 23 // NOTE if the client goes away before the compositor it must call 24 // SynchronousCompositor::SetClient(NULL) to release the back pointer. 25 virtual void DidDestroyCompositor(SynchronousCompositor* compositor) = 0; 26 27 // See LayerScrollOffsetDelegate for details. 28 virtual void SetTotalRootLayerScrollOffset(gfx::Vector2dF new_value) = 0; 29 virtual gfx::Vector2dF GetTotalRootLayerScrollOffset() = 0; 30 31 // When true, should periodically call 32 // SynchronousCompositorOutputSurface::DemandDrawHw. Note that this value 33 // can change inside DemandDrawHw call. 34 virtual void SetContinuousInvalidate(bool invalidate) = 0; 35 36 protected: 37 SynchronousCompositorClient() {} 38 virtual ~SynchronousCompositorClient() {} 39 40 private: 41 DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorClient); 42}; 43 44} // namespace content 45 46#endif // CONTENT_PUBLIC_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_CLIENT_H_ 47