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

Unified Diff: src/gpu/GrPathRenderingDrawContext.cpp

Issue 1701013002: Create GrPathRenderingDrawContext (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 10 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
Index: src/gpu/GrPathRenderingDrawContext.cpp
diff --git a/src/gpu/GrPathRenderingDrawContext.cpp b/src/gpu/GrPathRenderingDrawContext.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..8067dcb4dbdbf2c65b1e5b7410bb45d7cf70a14f
--- /dev/null
+++ b/src/gpu/GrPathRenderingDrawContext.cpp
@@ -0,0 +1,76 @@
+/*
+ * Copyright 2016 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "GrPathRenderingDrawContext.h"
+
+#include "GrDrawingManager.h"
+
+#include "text/GrStencilAndCoverTextContext.h"
+
robertphillips 2016/02/16 17:05:11 Do we need OWNED_RESOURCE ?
+#define ASSERT_OWNED_RESOURCE(R) SkASSERT(!(R) || \
+ (R)->getContext() == this->drawingManager()->getContext())
+#define ASSERT_SINGLE_OWNER \
+ SkDEBUGCODE(GrSingleOwner::AutoEnforce debug_SingleOwner(this->singleOwner());)
+#define RETURN_IF_ABANDONED if (this->drawingManager()->abandoned()) { return; }
robertphillips 2016/02/16 17:05:11 rm _FALSE & _NULL flavors ?
+#define RETURN_FALSE_IF_ABANDONED if (this->drawingManager()->abandoned()) { return false; }
+#define RETURN_NULL_IF_ABANDONED if (this->drawingManager()->abandoned()) { return nullptr; }
+
+void GrPathRenderingDrawContext::drawText(const GrClip& clip, const GrPaint& grPaint,
+ const SkPaint& skPaint,
+ const SkMatrix& viewMatrix, const char text[],
+ size_t byteLength, SkScalar x, SkScalar y,
+ const SkIRect& clipBounds) {
+ ASSERT_SINGLE_OWNER
+ RETURN_IF_ABANDONED
+ SkDEBUGCODE(this->validate();)
robertphillips 2016/02/16 17:05:11 GrPathRenderingDrawContext:: ?
+ GR_AUDIT_TRAIL_AUTO_FRAME(this->auditTrail(), "GrDrawContext::drawText");
+
+ if (!fTextContext) {
+ fTextContext = GrStencilAndCoverTextContext::Create();
+ }
+
+ fTextContext->drawText(this->drawingManager()->getContext(), this, clip, grPaint, skPaint,
+ viewMatrix, this->surfaceProps(),
+ text, byteLength, x, y, clipBounds);
+}
robertphillips 2016/02/16 17:05:11 \n
+void GrPathRenderingDrawContext::drawPosText(const GrClip& clip, const GrPaint& grPaint,
+ const SkPaint& skPaint,
+ const SkMatrix& viewMatrix, const char text[],
+ size_t byteLength, const SkScalar pos[],
+ int scalarsPerPosition, const SkPoint& offset,
+ const SkIRect& clipBounds) {
+ ASSERT_SINGLE_OWNER
+ RETURN_IF_ABANDONED
+ SkDEBUGCODE(this->validate();)
robertphillips 2016/02/16 17:05:11 GrPathRenderingDrawContext:: ?
+ GR_AUDIT_TRAIL_AUTO_FRAME(this->auditTrail(), "GrDrawContext::drawPosText");
+
+ if (!fTextContext) {
+ fTextContext = GrStencilAndCoverTextContext::Create();
+ }
+
+ fTextContext->drawPosText(this->drawingManager()->getContext(), this, clip, grPaint, skPaint,
+ viewMatrix, this->surfaceProps(),
+ text, byteLength, pos, scalarsPerPosition, offset, clipBounds);
+}
robertphillips 2016/02/16 17:05:11 \n
+void GrPathRenderingDrawContext::drawTextBlob(const GrClip& clip, const SkPaint& skPaint,
+ const SkMatrix& viewMatrix, const SkTextBlob* blob,
+ SkScalar x, SkScalar y,
+ SkDrawFilter* filter, const SkIRect& clipBounds) {
+ ASSERT_SINGLE_OWNER
+ RETURN_IF_ABANDONED
+ SkDEBUGCODE(this->validate();)
robertphillips 2016/02/16 17:05:11 GrPathRenderingDrawContext:: ?
+ GR_AUDIT_TRAIL_AUTO_FRAME(this->auditTrail(), "GrDrawContext::drawTextBlob");
+
+ if (!fTextContext) {
+ fTextContext = GrStencilAndCoverTextContext::Create();
+ }
+
+ fTextContext->drawTextBlob(this->drawingManager()->getContext(), this, clip, skPaint,
+ viewMatrix, this->surfaceProps(), blob, x,
+ y, filter, clipBounds);
+}
+
« src/gpu/GrPathRenderingDrawContext.h ('K') | « src/gpu/GrPathRenderingDrawContext.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698