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

Unified Diff: src/gpu/GrDrawTarget.cpp

Issue 715903002: Push creation of default GP to the caller (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: added comment Created 6 years, 1 month 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 | « src/gpu/GrDrawTarget.h ('k') | src/gpu/GrInOrderDrawBuffer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDrawTarget.cpp
diff --git a/src/gpu/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp
index 82f1e60e49f7d0a9c8269208a39904d51b3049ce..3d858c363d7796a07540c9a5c0f7566568a58260 100644
--- a/src/gpu/GrDrawTarget.cpp
+++ b/src/gpu/GrDrawTarget.cpp
@@ -126,7 +126,6 @@ void GrDrawTarget::releaseGeometry() {
}
void GrDrawTarget::setClip(const GrClipData* clip) {
- clipWillBeSet(clip);
fClip = clip;
}
@@ -758,59 +757,6 @@ void GrDrawTarget::drawIndexedInstances(GrPrimitiveType type,
////////////////////////////////////////////////////////////////////////////////
-namespace {
-
-// position + (optional) texture coord
-extern const GrVertexAttrib gBWRectPosUVAttribs[] = {
- {kVec2f_GrVertexAttribType, 0, kPosition_GrVertexAttribBinding},
- {kVec2f_GrVertexAttribType, sizeof(SkPoint), kLocalCoord_GrVertexAttribBinding}
-};
-
-void set_vertex_attributes(GrDrawState* drawState, bool hasUVs) {
- if (hasUVs) {
- drawState->setVertexAttribs<gBWRectPosUVAttribs>(2, 2 * sizeof(SkPoint));
- } else {
- drawState->setVertexAttribs<gBWRectPosUVAttribs>(1, sizeof(SkPoint));
- }
-}
-
-};
-
-void GrDrawTarget::onDrawRect(const SkRect& rect,
- const SkRect* localRect,
- const SkMatrix* localMatrix) {
-
- set_vertex_attributes(this->drawState(), SkToBool(localRect));
-
- AutoReleaseGeometry geo(this, 4, 0);
- if (!geo.succeeded()) {
- SkDebugf("Failed to get space for vertices!\n");
- return;
- }
-
- size_t vstride = this->drawState()->getVertexStride();
- geo.positions()->setRectFan(rect.fLeft, rect.fTop, rect.fRight, rect.fBottom, vstride);
- if (localRect) {
- SkPoint* coords = GrTCast<SkPoint*>(GrTCast<intptr_t>(geo.vertices()) +
- sizeof(SkPoint));
- coords->setRectFan(localRect->fLeft, localRect->fTop,
- localRect->fRight, localRect->fBottom,
- vstride);
- if (localMatrix) {
- localMatrix->mapPointsWithStride(coords, vstride, 4);
- }
- }
- SkRect bounds;
- this->getDrawState().getViewMatrix().mapRect(&bounds, rect);
-
- this->drawNonIndexed(kTriangleFan_GrPrimitiveType, 0, 4, &bounds);
-}
-
-void GrDrawTarget::clipWillBeSet(const GrClipData* clipData) {
-}
-
-////////////////////////////////////////////////////////////////////////////////
-
GrDrawTarget::AutoStateRestore::AutoStateRestore() {
fDrawTarget = NULL;
}
« no previous file with comments | « src/gpu/GrDrawTarget.h ('k') | src/gpu/GrInOrderDrawBuffer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698