15d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// Copyright 2014 The Chromium Authors. All rights reserved.
25d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
35d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// found in the LICENSE file.
45d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
55d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#ifndef CC_LAYERS_LAYER_UTILS_H_
65d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#define CC_LAYERS_LAYER_UTILS_H_
75d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
85d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#include "cc/base/cc_export.h"
95d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
105d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)namespace gfx {
115d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  class BoxF;
125d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)}  // namespace gfx
135d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
145d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)namespace cc {
155d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  class LayerImpl;
165d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
175d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  class CC_EXPORT LayerUtils {
185d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)   public:
195d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)    // Computes a box in screen space that should entirely contain the layer's
205d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)    // bounds through the entirety of the layer's current animation. Returns
215d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)    // true and sets |out| to the inflation if there are animations that can
225d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)    // inflate bounds in the path to the root layer and that it was able to
235d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)    // inflate correctly. Returns false otherwise.
245d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)    static bool GetAnimationBounds(const LayerImpl& layer, gfx::BoxF* out);
255d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  };
265d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
275d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)}  // namespace cc
285d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
295d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#endif  // CC_LAYERS_LAYER_UTILS_H_
30