mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
I wrote a script to do this which is attached to the bug. TBR=abarth@chromium.org BUG=435361 Review URL: https://codereview.chromium.org/736373003
64 lines
2.1 KiB
C++
64 lines
2.1 KiB
C++
// 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 SKY_ENGINE_CORE_RENDERING_PAINTINVALIDATIONSTATE_H_
|
|
#define SKY_ENGINE_CORE_RENDERING_PAINTINVALIDATIONSTATE_H_
|
|
|
|
#include "sky/engine/platform/geometry/LayoutRect.h"
|
|
#include "sky/engine/wtf/Noncopyable.h"
|
|
|
|
namespace blink {
|
|
|
|
class RenderBox;
|
|
class RenderInline;
|
|
class RenderLayerModelObject;
|
|
class RenderObject;
|
|
class RenderView;
|
|
|
|
class PaintInvalidationState {
|
|
WTF_MAKE_NONCOPYABLE(PaintInvalidationState);
|
|
public:
|
|
PaintInvalidationState(const PaintInvalidationState& next, RenderLayerModelObject& renderer, const RenderLayerModelObject& paintInvalidationContainer);
|
|
|
|
explicit PaintInvalidationState(const RenderView&);
|
|
|
|
const LayoutRect& clipRect() const { return m_clipRect; }
|
|
const LayoutSize& paintOffset() const { return m_paintOffset; }
|
|
|
|
bool cachedOffsetsEnabled() const { return m_cachedOffsetsEnabled; }
|
|
bool isClipped() const { return m_clipped; }
|
|
|
|
bool forceCheckForPaintInvalidation() const { return m_forceCheckForPaintInvalidation; }
|
|
void setForceCheckForPaintInvalidation() { m_forceCheckForPaintInvalidation = true; }
|
|
|
|
const RenderLayerModelObject& paintInvalidationContainer() const { return m_paintInvalidationContainer; }
|
|
const RenderObject& renderer() const { return m_renderer; }
|
|
|
|
bool canMapToContainer(const RenderLayerModelObject* container) const
|
|
{
|
|
return m_cachedOffsetsEnabled && container == &m_paintInvalidationContainer;
|
|
}
|
|
private:
|
|
void applyClipIfNeeded(const RenderObject&);
|
|
|
|
friend class ForceHorriblySlowRectMapping;
|
|
|
|
bool m_clipped;
|
|
mutable bool m_cachedOffsetsEnabled;
|
|
bool m_forceCheckForPaintInvalidation;
|
|
|
|
LayoutRect m_clipRect;
|
|
|
|
// x/y offset from paint invalidation container. Includes relative positioning and scroll offsets.
|
|
LayoutSize m_paintOffset;
|
|
|
|
const RenderLayerModelObject& m_paintInvalidationContainer;
|
|
|
|
const RenderObject& m_renderer;
|
|
};
|
|
|
|
} // namespace blink
|
|
|
|
#endif // SKY_ENGINE_CORE_RENDERING_PAINTINVALIDATIONSTATE_H_
|