Index: cc/paint/paint_shader.h |
diff --git a/cc/paint/paint_shader.h b/cc/paint/paint_shader.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..4c91beacd99d4691b3dc6dfaf6cea4a9d76f68f8 |
--- /dev/null |
+++ b/cc/paint/paint_shader.h |
@@ -0,0 +1,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 { |
+typedef SkShader PaintShader; |
+ |
+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> MakePaintShaderPicture(sk_sp<PaintRecord> record, |
danakj
2017/01/20 23:34:13
should this have Picture in its name or PaintRecor
enne (OOO)
2017/01/24 01:51:27
PaintShaderPicture => PaintShaderRecord.
|
+ 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_ |