forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpaint_shader.h
43 lines (34 loc) · 1.65 KB
/
paint_shader.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Copyright 2017 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 CC_PAINT_PAINT_SHADER_H_
#define CC_PAINT_PAINT_SHADER_H_
#include "cc/paint/paint_record.h"
#include "third_party/skia/include/core/SkImage.h"
#include "third_party/skia/include/core/SkShader.h"
namespace cc {
using PaintShader = SkShader;
inline sk_sp<PaintShader> WrapSkShader(sk_sp<SkShader> shader) {
return shader;
}
inline sk_sp<PaintShader> MakePaintShaderImage(const SkImage* image,
SkShader::TileMode tx,
SkShader::TileMode ty,
const SkMatrix* local_matrix) {
return image->makeShader(tx, ty, local_matrix);
}
inline sk_sp<PaintShader> MakePaintShaderImage(const sk_sp<SkImage> image,
SkShader::TileMode tx,
SkShader::TileMode ty,
const SkMatrix* local_matrix) {
return image->makeShader(tx, ty, local_matrix);
}
inline sk_sp<PaintShader> MakePaintShaderRecord(sk_sp<PaintRecord> record,
SkShader::TileMode tx,
SkShader::TileMode ty,
const SkMatrix* local_matrix,
const SkRect* tile) {
return SkShader::MakePictureShader(record, tx, ty, local_matrix, tile);
}
} // namespace cc
#endif // CC_PAINT_PAINT_SHADER_H_