aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/beziereffects.cpp
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2016-10-27 14:47:55 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-10-27 19:14:09 +0000
commit1105224f9701e57ec5ce0354d6a380b664f5c638 (patch)
tree2b6f3db0bfd99da5e22adabc0da37d9271c8b543 /gm/beziereffects.cpp
parent6e74412a9cf1ffa44271a55b42f18e8a0813a0a2 (diff)
Rename GrDrawContext to GrRenderTargetContext
This is in preparation for GrTextureContext and GrSurfaceContext BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4030 Change-Id: Ie58c93052e68f3f1f5fe8d15d63760de274a6fbd Reviewed-on: https://skia-review.googlesource.com/4030 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'gm/beziereffects.cpp')
-rw-r--r--gm/beziereffects.cpp38
1 files changed, 22 insertions, 16 deletions
diff --git a/gm/beziereffects.cpp b/gm/beziereffects.cpp
index 3dd4d65f7f..c6d58e17f0 100644
--- a/gm/beziereffects.cpp
+++ b/gm/beziereffects.cpp
@@ -11,7 +11,7 @@
#if SK_SUPPORT_GPU
-#include "GrDrawContextPriv.h"
+#include "GrRenderTargetContextPriv.h"
#include "GrContext.h"
#include "GrPathUtils.h"
#include "GrTest.h"
@@ -99,8 +99,9 @@ protected:
}
void onDraw(SkCanvas* canvas) override {
- GrDrawContext* drawContext = canvas->internal_private_accessTopLayerDrawContext();
- if (!drawContext) {
+ GrRenderTargetContext* renderTargetContext =
+ canvas->internal_private_accessTopLayerRenderTargetContext();
+ if (!renderTargetContext) {
skiagm::GM::DrawGpuOnlyMessage(canvas);
return;
}
@@ -121,8 +122,8 @@ protected:
// Mult by 3 for each edge effect type
int numCols = SkScalarCeilToInt(SkScalarSqrt(SkIntToScalar(kNumCubics*3)));
int numRows = SkScalarCeilToInt(SkIntToScalar(kNumCubics*3) / numCols);
- SkScalar w = SkIntToScalar(drawContext->width()) / numCols;
- SkScalar h = SkIntToScalar(drawContext->height()) / numRows;
+ SkScalar w = SkIntToScalar(renderTargetContext->width()) / numCols;
+ SkScalar h = SkIntToScalar(renderTargetContext->height()) / numRows;
int row = 0;
int col = 0;
constexpr GrColor color = 0xff000000;
@@ -194,7 +195,8 @@ protected:
SkAutoTUnref<GrDrawBatch> batch(
new BezierCubicOrConicTestBatch(gp, bounds, color, klmEqs, klmSigns[c]));
- drawContext->drawContextPriv().testingOnly_drawBatch(grPaint, batch);
+ renderTargetContext->renderTargetContextPriv().testingOnly_drawBatch(grPaint,
+ batch);
}
++col;
if (numCols == col) {
@@ -231,8 +233,9 @@ protected:
void onDraw(SkCanvas* canvas) override {
- GrDrawContext* drawContext = canvas->internal_private_accessTopLayerDrawContext();
- if (!drawContext) {
+ GrRenderTargetContext* renderTargetContext =
+ canvas->internal_private_accessTopLayerRenderTargetContext();
+ if (!renderTargetContext) {
skiagm::GM::DrawGpuOnlyMessage(canvas);
return;
}
@@ -253,8 +256,8 @@ protected:
// Mult by 3 for each edge effect type
int numCols = SkScalarCeilToInt(SkScalarSqrt(SkIntToScalar(kNumConics*3)));
int numRows = SkScalarCeilToInt(SkIntToScalar(kNumConics*3) / numCols);
- SkScalar w = SkIntToScalar(drawContext->width()) / numCols;
- SkScalar h = SkIntToScalar(drawContext->height()) / numRows;
+ SkScalar w = SkIntToScalar(renderTargetContext->width()) / numCols;
+ SkScalar h = SkIntToScalar(renderTargetContext->height()) / numRows;
int row = 0;
int col = 0;
constexpr GrColor color = 0xff000000;
@@ -325,7 +328,8 @@ protected:
SkAutoTUnref<GrDrawBatch> batch(
new BezierCubicOrConicTestBatch(gp, bounds, color, klmEqs, 1.f));
- drawContext->drawContextPriv().testingOnly_drawBatch(grPaint, batch);
+ renderTargetContext->renderTargetContextPriv().testingOnly_drawBatch(grPaint,
+ batch);
}
++col;
if (numCols == col) {
@@ -445,8 +449,9 @@ protected:
void onDraw(SkCanvas* canvas) override {
- GrDrawContext* drawContext = canvas->internal_private_accessTopLayerDrawContext();
- if (!drawContext) {
+ GrRenderTargetContext* renderTargetContext =
+ canvas->internal_private_accessTopLayerRenderTargetContext();
+ if (!renderTargetContext) {
skiagm::GM::DrawGpuOnlyMessage(canvas);
return;
}
@@ -466,8 +471,8 @@ protected:
int numCols = SkScalarCeilToInt(SkScalarSqrt(SkIntToScalar(kNumQuads*3)));
int numRows = SkScalarCeilToInt(SkIntToScalar(kNumQuads*3) / numCols);
- SkScalar w = SkIntToScalar(drawContext->width()) / numCols;
- SkScalar h = SkIntToScalar(drawContext->height()) / numRows;
+ SkScalar w = SkIntToScalar(renderTargetContext->width()) / numCols;
+ SkScalar h = SkIntToScalar(renderTargetContext->height()) / numRows;
int row = 0;
int col = 0;
constexpr GrColor color = 0xff000000;
@@ -536,7 +541,8 @@ protected:
SkAutoTUnref<GrDrawBatch> batch(
new BezierQuadTestBatch(gp, bounds, color, DevToUV));
- drawContext->drawContextPriv().testingOnly_drawBatch(grPaint, batch);
+ renderTargetContext->renderTargetContextPriv().testingOnly_drawBatch(grPaint,
+ batch);
}
++col;
if (numCols == col) {