blob: d702c6c758fe0d1cb585c61e4f0c130c052511a2 [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 THIRD_PARTY_BLINK_RENDERER_PLATFORM_GRAPHICS_PAINT_DISPLAY_ITEM_CACHE_SKIPPER_H_
#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_GRAPHICS_PAINT_DISPLAY_ITEM_CACHE_SKIPPER_H_
#include "base/macros.h"
#include "third_party/blink/renderer/platform/graphics/graphics_context.h"
#include "third_party/blink/renderer/platform/graphics/paint/paint_controller.h"
#include "third_party/blink/renderer/platform/wtf/allocator/allocator.h"
namespace blink {
class DisplayItemCacheSkipper final {
STACK_ALLOCATED();
public:
explicit DisplayItemCacheSkipper(GraphicsContext& context)
: context_(context) {
context.GetPaintController().BeginSkippingCache();
}
~DisplayItemCacheSkipper() {
context_.GetPaintController().EndSkippingCache();
}
private:
GraphicsContext& context_;
DISALLOW_COPY_AND_ASSIGN(DisplayItemCacheSkipper);
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_GRAPHICS_PAINT_DISPLAY_ITEM_CACHE_SKIPPER_H_