1926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)/*
2926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * Copyright (C) 2013 Google Inc. All rights reserved.
3926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) *
4926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * Redistribution and use in source and binary forms, with or without
5926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * modification, are permitted provided that the following conditions are
6926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * met:
7926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) *
8926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * 1. Redistributions of source code must retain the above copyright
9926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * notice, this list of conditions and the following disclaimer.
10926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) *
11926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * 2. Redistributions in binary form must reproduce the above
12926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * copyright notice, this list of conditions and the following disclaimer
13926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * in the documentation and/or other materials provided with the
14926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * distribution.
15926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) *
16926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * THIS SOFTWARE IS PROVIDED BY GOOGLE INC. AND ITS CONTRIBUTORS
17926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GOOGLE INC.
20926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) */
28926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)
29926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)#include "config.h"
30f91f5fa1608c2cdd9af1842fb5dadbe78275be2aBo Liu#include "web/painting/ContinuousPainter.h"
31926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)
321e202183a5dc46166763171984b285173f8585e5Torne (Richard Coles)#include "platform/TraceEvent.h"
33a854de003a23bf3c7f95ec0f8154ada64092ff5cTorne (Richard Coles)#include "platform/graphics/GraphicsLayer.h"
34f91f5fa1608c2cdd9af1842fb5dadbe78275be2aBo Liu#include "web/PageOverlayList.h"
35926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)
36c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles)using namespace blink;
37926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)
3851b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)namespace blink {
39926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)
40926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)void ContinuousPainter::setNeedsDisplayRecursive(GraphicsLayer* layer, PageOverlayList* pageOverlays)
41926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles){
42926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)    if (!layer)
43926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)        return;
44926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)
4506f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)    if (pageOverlays && pageOverlays->findGraphicsLayer(layer) != WTF::kNotFound)
46926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)        return;
47926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)
48197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch    TRACE_EVENT0("blink", "ContinuousPainter::setNeedsDisplayRecursive");
49926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)    layer->setNeedsDisplay();
50926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)
51926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)    setNeedsDisplayRecursive(layer->maskLayer(), pageOverlays);
5206f816c7c76bc45a15e452ade8a34e8af077693eTorne (Richard Coles)    setNeedsDisplayRecursive(layer->contentsClippingMaskLayer(), pageOverlays);
53926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)    setNeedsDisplayRecursive(layer->replicaLayer(), pageOverlays);
54926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)
55926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)    const Vector<GraphicsLayer*>& children = layer->children();
56926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)    Vector<GraphicsLayer*>::const_iterator it;
57926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)    for (it = children.begin(); it != children.end(); ++it)
58926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)        setNeedsDisplayRecursive(*it, pageOverlays);
59926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)}
60926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)
6151b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)} // namespace blink
62