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

Side by Side Diff: include/core/SkCanvas.h

Issue 1832223002: switch xfermodes over to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 4 years, 8 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkCanvas_DEFINED 8 #ifndef SkCanvas_DEFINED
9 #define SkCanvas_DEFINED 9 #define SkCanvas_DEFINED
10 10
(...skipping 1035 matching lines...) Expand 10 before | Expand all | Expand 10 after
1046 @param indices If not null, array of indices to reference into the 1046 @param indices If not null, array of indices to reference into the
1047 vertex (texs, colors) array. 1047 vertex (texs, colors) array.
1048 @param indexCount number of entries in the indices array (if not null) 1048 @param indexCount number of entries in the indices array (if not null)
1049 @param paint Specifies the shader/texture if present. 1049 @param paint Specifies the shader/texture if present.
1050 */ 1050 */
1051 void drawVertices(VertexMode vmode, int vertexCount, 1051 void drawVertices(VertexMode vmode, int vertexCount,
1052 const SkPoint vertices[], const SkPoint texs[], 1052 const SkPoint vertices[], const SkPoint texs[],
1053 const SkColor colors[], SkXfermode* xmode, 1053 const SkColor colors[], SkXfermode* xmode,
1054 const uint16_t indices[], int indexCount, 1054 const uint16_t indices[], int indexCount,
1055 const SkPaint& paint); 1055 const SkPaint& paint);
1056 void drawVertices(VertexMode vmode, int vertexCount,
1057 const SkPoint vertices[], const SkPoint texs[],
1058 const SkColor colors[], sk_sp<SkXfermode>& xmode,
1059 const uint16_t indices[], int indexCount,
1060 const SkPaint& paint) {
1061 this->drawVertices(vmode, vertexCount, vertices, texs, colors, xmode.get (),
1062 indices, indexCount, paint);
1063 }
1056 1064
1057 /** 1065 /**
1058 Draw a cubic coons patch 1066 Draw a cubic coons patch
1059 1067
1060 @param cubic specifies the 4 bounding cubic bezier curves of a patch with c lockwise order 1068 @param cubic specifies the 4 bounding cubic bezier curves of a patch with c lockwise order
1061 starting at the top left corner. 1069 starting at the top left corner.
1062 @param colors specifies the colors for the corners which will be bilerp acr oss the patch, 1070 @param colors specifies the colors for the corners which will be bilerp acr oss the patch,
1063 their order is clockwise starting at the top left corner. 1071 their order is clockwise starting at the top left corner.
1064 @param texCoords specifies the texture coordinates that will be bilerp acro ss the patch, 1072 @param texCoords specifies the texture coordinates that will be bilerp acro ss the patch,
1065 their order is the same as the colors. 1073 their order is the same as the colors.
1066 @param xmode specifies how are the colors and the textures combined if both of them are 1074 @param xmode specifies how are the colors and the textures combined if both of them are
1067 present. 1075 present.
1068 @param paint Specifies the shader/texture if present. 1076 @param paint Specifies the shader/texture if present.
1069 */ 1077 */
1070 void drawPatch(const SkPoint cubics[12], const SkColor colors[4], 1078 void drawPatch(const SkPoint cubics[12], const SkColor colors[4],
1071 const SkPoint texCoords[4], SkXfermode* xmode, const SkPaint& paint); 1079 const SkPoint texCoords[4], SkXfermode* xmode, const SkPaint& paint);
1080 void drawPatch(const SkPoint cubics[12], const SkColor colors[4], const SkPo int texCoords[4],
1081 const sk_sp<SkXfermode>& xmode, const SkPaint& paint) {
1082 this->drawPatch(cubics, colors, texCoords, xmode.get(), paint);
1083 }
1072 1084
1073 /** 1085 /**
1074 * Draw a set of sprites from the atlas. Each is specified by a tex rectang le in the 1086 * Draw a set of sprites from the atlas. Each is specified by a tex rectang le in the
1075 * coordinate space of the atlas, and a corresponding xform which transform s the tex rectangle 1087 * coordinate space of the atlas, and a corresponding xform which transform s the tex rectangle
1076 * into a quad. 1088 * into a quad.
1077 * 1089 *
1078 * xform maps [0, 0, tex.width, tex.height] -> quad 1090 * xform maps [0, 0, tex.width, tex.height] -> quad
1079 * 1091 *
1080 * The color array is optional. When specified, each color modulates the pi xels in its 1092 * The color array is optional. When specified, each color modulates the pi xels in its
1081 * corresponding quad (via the specified SkXfermode::Mode). 1093 * corresponding quad (via the specified SkXfermode::Mode).
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
1554 1566
1555 class SkCanvasClipVisitor { 1567 class SkCanvasClipVisitor {
1556 public: 1568 public:
1557 virtual ~SkCanvasClipVisitor(); 1569 virtual ~SkCanvasClipVisitor();
1558 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0; 1570 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0;
1559 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0; 1571 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0;
1560 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0; 1572 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0;
1561 }; 1573 };
1562 1574
1563 #endif 1575 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698