1 // Copyright (c) 2012 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.
5 #ifndef UI_COMPOSITOR_LAYER_DELEGATE_H_
6 #define UI_COMPOSITOR_LAYER_DELEGATE_H_
8 #include "base/callback_forward.h"
9 #include "ui/compositor/compositor_export.h"
17 // A delegate interface implemented by an object that renders to a Layer.
18 class COMPOSITOR_EXPORT LayerDelegate
{
20 // Paint content for the layer to the specified canvas. It has already been
21 // clipped to the Layer's invalid rect.
22 virtual void OnPaintLayer(gfx::Canvas
* canvas
) = 0;
24 // Called when the layer's device scale factor has changed.
25 virtual void OnDeviceScaleFactorChanged(float device_scale_factor
) = 0;
27 // Invoked prior to the bounds changing. The returned closured is run after
29 virtual base::Closure
PrepareForLayerBoundsChange() = 0;
32 virtual ~LayerDelegate() {}
37 #endif // UI_COMPOSITOR_LAYER_DELEGATE_H_