blob: a7c0add99b9b1f10e5848203362a63a87ee522cd [file] [log] [blame]
// Copyright 2015 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 ScrollRecorder_h
#define ScrollRecorder_h
#include "core/CoreExport.h"
#include "core/paint/PaintPhase.h"
#include "platform/geometry/IntSize.h"
#include "platform/graphics/paint/DisplayItem.h"
#include "wtf/Allocator.h"
namespace blink {
class GraphicsContext;
// Emits display items which represent a region which is scrollable, so that it
// can be translated by the scroll offset.
class CORE_EXPORT ScrollRecorder {
USING_FAST_MALLOC(ScrollRecorder);
public:
ScrollRecorder(GraphicsContext&, const DisplayItemClient&, DisplayItem::Type, const IntSize& currentOffset);
ScrollRecorder(GraphicsContext&, const DisplayItemClient&, PaintPhase, const IntSize& currentOffset);
~ScrollRecorder();
private:
const DisplayItemClient& m_client;
DisplayItem::Type m_beginItemType;
GraphicsContext& m_context;
};
} // namespace blink
#endif // ScrollRecorder_h