Supervised user whitelists: Cleanup
[chromium-blink-merge.git] / ui / compositor / layer_delegate.h
blobc3c4e39aed6ede950c787357720ea90b85bc5e9c
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"
11 namespace gfx {
12 class Canvas;
13 class Rect;
16 namespace ui {
17 class PaintContext;
19 // A delegate interface implemented by an object that renders to a Layer.
20 class COMPOSITOR_EXPORT LayerDelegate {
21 public:
22 // Paint content for the layer to the specified context.
23 virtual void OnPaintLayer(const PaintContext& context) = 0;
25 // A notification that this layer has had a delegated frame swap and
26 // will be repainted.
27 virtual void OnDelegatedFrameDamage(const gfx::Rect& damage_rect_in_dip) = 0;
29 // Called when the layer's device scale factor has changed.
30 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) = 0;
32 // Invoked prior to the bounds changing. The returned closured is run after
33 // the bounds change.
34 virtual base::Closure PrepareForLayerBoundsChange() = 0;
36 protected:
37 virtual ~LayerDelegate() {}
40 } // namespace ui
42 #endif // UI_COMPOSITOR_LAYER_DELEGATE_H_