blob: ea252d1a628e20ff6f1f0738a4950854061302f1 [file] [log] [blame]
// 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 ImagePattern_h
#define ImagePattern_h
#include "platform/graphics/Pattern.h"
#include "platform/graphics/paint/PaintImage.h"
namespace blink {
class Image;
class PLATFORM_EXPORT ImagePattern final : public Pattern {
public:
static scoped_refptr<ImagePattern> Create(scoped_refptr<Image>, RepeatMode);
bool IsTextureBacked() const override;
protected:
sk_sp<PaintShader> CreateShader(const SkMatrix&) override;
bool IsLocalMatrixChanged(const SkMatrix&) const override;
private:
ImagePattern(scoped_refptr<Image>, RepeatMode);
SkMatrix previous_local_matrix_;
PaintImage tile_image_;
};
} // namespace blink
#endif /* ImagePattern_h */