summaryrefslogtreecommitdiffstats
path: root/cc/trees/draw_property_utils.h
blob: 6da912b17a95b17dbd9a02b69df774e4a95cd4c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Copyright 2014 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 CC_TREES_DRAW_PROPERTY_UTILS_H_
#define CC_TREES_DRAW_PROPERTY_UTILS_H_

#include "cc/base/cc_export.h"

namespace gfx {
class Rect;
class Transform;
}  // namespace gfx

namespace cc {

class ClipTree;
class Layer;
class TransformTree;

// Computes combined clips for every node in |clip_tree|. This function requires
// that |transform_tree| has been updated via |ComputeTransforms|.
// TODO(vollick): ComputeClips and ComputeTransforms will eventually need to be
// done on both threads.
void CC_EXPORT
ComputeClips(ClipTree* clip_tree, const TransformTree& transform_tree);

// Computes combined (screen space) transforms for every node in the transform
// tree. This must be done prior to calling |ComputeClips|.
void CC_EXPORT ComputeTransforms(TransformTree* transform_tree);

// Computes the visible content rect for every layer under |root_layer|. The
// visible content rect is the clipped content space rect that will be used for
// recording.
void CC_EXPORT
ComputeVisibleRectsUsingPropertyTrees(Layer* root_layer,
                                      const Layer* page_scale_layer,
                                      float page_scale_factor,
                                      float device_scale_factor,
                                      const gfx::Rect& viewport,
                                      const gfx::Transform& device_transform,
                                      TransformTree* transform_tree,
                                      ClipTree* clip_tree);

}  // namespace cc

#endif  // CC_TREES_DRAW_PROPERTY_UTILS_H_