aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrDrawTarget.h
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-03-20 17:32:27 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-03-20 17:32:27 +0000
commitae81d5c4aa1716756b2cfb4c44f27f4dce2716ef (patch)
tree019b5c1b55da3c7da77943f8b93f5cc28da090c2 /src/gpu/GrDrawTarget.h
parent723dd790fbef396cd5c6619d0a3656c641b0c3f5 (diff)
Adds local coords to GrEffect system.
Effects can ask the builder for local coords which may or may not be distinct from positions. GrEffectStage tracks changes to relationship between pos and local coords. GrGLEffectMatrix and GrSingleTextureEffect can use either pos or textures as intput coords GrSimpleTextureEffect now allows for an explicit texture coords attribute. Review URL: https://codereview.chromium.org/12531015 git-svn-id: http://skia.googlecode.com/svn/trunk@8264 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu/GrDrawTarget.h')
-rw-r--r--src/gpu/GrDrawTarget.h29
1 files changed, 12 insertions, 17 deletions
diff --git a/src/gpu/GrDrawTarget.h b/src/gpu/GrDrawTarget.h
index a011aaef99..de8c5c4580 100644
--- a/src/gpu/GrDrawTarget.h
+++ b/src/gpu/GrDrawTarget.h
@@ -388,8 +388,8 @@ public:
/**
* Helper function for drawing rects. This does not use the current index
* and vertex sources. After returning, the vertex and index sources may
- * have changed. They should be reestablished before the next drawIndexed
- * or drawNonIndexed. This cannot be called between reserving and releasing
+ * have changed. They should be reestablished before the next draw call.
+ * This cannot be called between reserving and releasing
* geometry.
*
* A subclass may override this to perform more optimal rect rendering. Its
@@ -397,34 +397,29 @@ public:
* (e.g. drawNonIndexed, drawIndexedInstances, ...). The base class draws a two
* triangle fan using drawNonIndexed from reserved vertex space.
*
- * @param rect the rect to draw
- * @param matrix optional matrix applied to rect (before viewMatrix)
- * @param srcRects specifies rect for explicit texture coordinates.
- * if srcRect is non-NULL then that rect will be used
- * as the coordinates for the given stage.
- * @param srcMatrix optional matrix applied to srcRect. If
+ * @param rect the rect to draw
+ * @param matrix optional matrix applied to rect (before viewMatrix)
+ * @param localRect optional rect that specifies local coords to map onto
+ * rect. If NULL then rect serves as the local coords.
+ * @param localMatrix optional matrix applied to localRect. If
* srcRect is non-NULL and srcMatrix is non-NULL
* then srcRect will be transformed by srcMatrix.
* srcMatrix can be NULL when no srcMatrix is desired.
- * @param stage the stage to be given explicit texture coordinates.
- * Ignored if srcRect is NULL.
*/
virtual void drawRect(const GrRect& rect,
const SkMatrix* matrix,
- const GrRect* srcRect,
- const SkMatrix* srcMatrix,
- int stage);
+ const GrRect* localRect,
+ const SkMatrix* localMatrix);
/**
- * Helper for drawRect when the caller doesn't need separate src rects or
- * matrices.
+ * Helper for drawRect when the caller doesn't need separate local rects or matrices.
*/
void drawSimpleRect(const GrRect& rect, const SkMatrix* matrix = NULL) {
- drawRect(rect, matrix, NULL, NULL, 0);
+ drawRect(rect, matrix, NULL, NULL);
}
void drawSimpleRect(const GrIRect& irect, const SkMatrix* matrix = NULL) {
SkRect rect = SkRect::MakeFromIRect(irect);
- this->drawRect(rect, matrix, NULL, NULL, 0);
+ this->drawRect(rect, matrix, NULL, NULL);
}
/**