Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(308)

Unified Diff: cc/paint/paint_shader.h

Issue 2640983002: Rename paint data structures (Closed)
Patch Set: DrawingDisplayItem Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/paint/paint_recorder.h ('k') | cc/paint/paint_surface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..f519703eb88c1d5ea69d46eff8890fd76a9ab8a9
--- /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 {
+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_
« no previous file with comments | « cc/paint/paint_recorder.h ('k') | cc/paint/paint_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698