1f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles)/*
2f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles) * Copyright (C) 2003, 2009, 2012 Apple Inc. All rights reserved.
3f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles) * Copyright (C) 2013 Intel Corporation. All rights reserved.
4f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles) *
5f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles) * Portions are Copyright (C) 1998 Netscape Communications Corporation.
6f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles) *
7f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles) * Other contributors:
8f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles) *   Robert O'Callahan <roc+@cs.cmu.edu>
9f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles) *   David Baron <dbaron@fas.harvard.edu>
10f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles) *   Christian Biesinger <cbiesinger@web.de>
11f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles) *   Randall Jesup <rjesup@wgate.com>
12f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles) *   Roland Mainz <roland.mainz@informatik.med.uni-giessen.de>
13f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles) *   Josh Soref <timeless@mac.com>
14f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles) *   Boris Zbarsky <bzbarsky@mit.edu>
15f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles) *
16f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles) * This library is free software; you can redistribute it and/or
17f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles) * modify it under the terms of the GNU Lesser General Public
18f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles) * License as published by the Free Software Foundation; either
19f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles) * version 2.1 of the License, or (at your option) any later version.
20f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles) *
21f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles) * This library is distributed in the hope that it will be useful,
22f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles) * but WITHOUT ANY WARRANTY; without even the implied warranty of
23f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles) * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
24f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles) * Lesser General Public License for more details.
25f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles) *
26f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles) * You should have received a copy of the GNU Lesser General Public
27f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles) * License along with this library; if not, write to the Free Software
28f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles) * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
29f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles) *
30f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles) * Alternatively, the contents of this file may be used under the terms
31f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles) * of either the Mozilla Public License Version 1.1, found at
32f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles) * http://www.mozilla.org/MPL/ (the "MPL") or the GNU General Public
33f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles) * License Version 2.0, found at http://www.fsf.org/copyleft/gpl.html
34f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles) * (the "GPL"), in which case the provisions of the MPL or the GPL are
35f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles) * applicable instead of those above.  If you wish to allow use of your
36f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles) * version of this file only under the terms of one of those two
37f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles) * licenses (the MPL or the GPL) and not to allow others to use your
38f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles) * version of this file under the LGPL, indicate your decision by
39f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles) * deletingthe provisions above and replace them with the notice and
40f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles) * other provisions required by the MPL or the GPL, as the case may be.
41f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles) * If you do not delete the provisions above, a recipient may use your
42f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles) * version of this file under any of the LGPL, the MPL or the GPL.
43f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles) */
44f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles)
45f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles)#ifndef LayerPaintingInfo_h
46f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles)#define LayerPaintingInfo_h
47f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles)
48f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles)#include "core/rendering/PaintInfo.h"
49f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles)#include "platform/geometry/LayoutRect.h"
50f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles)
51c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles)namespace blink {
52f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles)
53f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles)class RenderLayer;
54f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles)
55f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles)enum PaintLayerFlag {
56f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles)    PaintLayerHaveTransparency = 1,
57f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles)    PaintLayerAppliedTransform = 1 << 1,
58197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch    PaintLayerUncachedClipRects = 1 << 2,
59f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles)    PaintLayerPaintingReflection = 1 << 3,
60f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles)    PaintLayerPaintingOverlayScrollbars = 1 << 4,
61f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles)    PaintLayerPaintingCompositingBackgroundPhase = 1 << 5,
62f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles)    PaintLayerPaintingCompositingForegroundPhase = 1 << 6,
63f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles)    PaintLayerPaintingCompositingMaskPhase = 1 << 7,
64f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles)    PaintLayerPaintingCompositingScrollingPhase = 1 << 8,
65f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles)    PaintLayerPaintingOverflowContents = 1 << 9,
66f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles)    PaintLayerPaintingRootBackgroundOnly = 1 << 10,
67f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles)    PaintLayerPaintingSkipRootBackground = 1 << 11,
68f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles)    PaintLayerPaintingChildClippingMaskPhase = 1 << 12,
69f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles)    PaintLayerPaintingCompositingAllPhases = (PaintLayerPaintingCompositingBackgroundPhase | PaintLayerPaintingCompositingForegroundPhase | PaintLayerPaintingCompositingMaskPhase)
70f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles)};
71f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles)
72f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles)typedef unsigned PaintLayerFlags;
73f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles)
74f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles)struct LayerPaintingInfo {
75f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles)    LayerPaintingInfo(RenderLayer* inRootLayer, const LayoutRect& inDirtyRect,
76f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles)        PaintBehavior inPaintBehavior, const LayoutSize& inSubPixelAccumulation,
77c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles)        RenderObject* inPaintingRoot = 0)
78f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles)        : rootLayer(inRootLayer)
79f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles)        , paintingRoot(inPaintingRoot)
80f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles)        , paintDirtyRect(inDirtyRect)
81f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles)        , subPixelAccumulation(inSubPixelAccumulation)
82f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles)        , paintBehavior(inPaintBehavior)
83f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles)        , clipToDirtyRect(true)
84f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles)    { }
85f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles)    RenderLayer* rootLayer;
86f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles)    RenderObject* paintingRoot; // only paint descendants of this object
87f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles)    LayoutRect paintDirtyRect; // relative to rootLayer;
88f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles)    LayoutSize subPixelAccumulation;
89f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles)    PaintBehavior paintBehavior;
90f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles)    bool clipToDirtyRect;
91f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles)};
92f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles)
93c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles)} // namespace blink
94f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles)
95f79f16f17ddc4f842d7b7a38603e280e94be826aTorne (Richard Coles)#endif // LayerPaintingInfo_h
96