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

Unified Diff: src/gpu/SkGpuDevice.cpp

Issue 292773002: Pass in GrContext instead of SkGpuDevice for dashing and Sk2GrPaint conversion (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Nit variable name Created 6 years, 7 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
« no previous file with comments | « include/gpu/SkGr.h ('k') | src/gpu/SkGr.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/SkGpuDevice.cpp
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 30cae78311e3d30496e43d4dfed36f9f9e3e0490..854839de2c4bdbaa359707a9c023a4a5499b05f6 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -398,7 +398,7 @@ void SkGpuDevice::drawPaint(const SkDraw& draw, const SkPaint& paint) {
CHECK_SHOULD_DRAW(draw, false);
GrPaint grPaint;
- SkPaint2GrPaintShader(this, paint, true, &grPaint);
+ SkPaint2GrPaintShader(this->context(), paint, true, &grPaint);
fContext->drawPaint(grPaint);
}
@@ -421,7 +421,7 @@ void SkGpuDevice::drawPoints(const SkDraw& draw, SkCanvas::PointMode mode,
}
if (paint.getPathEffect() && 2 == count && SkCanvas::kLines_PointMode == mode) {
- if (GrDashingEffect::DrawDashLine(pts, paint, this)) {
+ if (GrDashingEffect::DrawDashLine(pts, paint, this->context())) {
return;
}
}
@@ -434,7 +434,7 @@ void SkGpuDevice::drawPoints(const SkDraw& draw, SkCanvas::PointMode mode,
}
GrPaint grPaint;
- SkPaint2GrPaintShader(this, paint, true, &grPaint);
+ SkPaint2GrPaintShader(this->context(), paint, true, &grPaint);
fContext->drawVertices(grPaint,
gPointMode2PrimtiveType[mode],
@@ -491,7 +491,7 @@ void SkGpuDevice::drawRect(const SkDraw& draw, const SkRect& rect,
}
GrPaint grPaint;
- SkPaint2GrPaintShader(this, paint, true, &grPaint);
+ SkPaint2GrPaintShader(this->context(), paint, true, &grPaint);
if (!doStroke) {
fContext->drawRect(grPaint, rect);
@@ -509,7 +509,7 @@ void SkGpuDevice::drawRRect(const SkDraw& draw, const SkRRect& rect,
CHECK_SHOULD_DRAW(draw, false);
GrPaint grPaint;
- SkPaint2GrPaintShader(this, paint, true, &grPaint);
+ SkPaint2GrPaintShader(this->context(), paint, true, &grPaint);
SkStrokeRec stroke(paint);
if (paint.getMaskFilter()) {
@@ -563,7 +563,7 @@ void SkGpuDevice::drawDRRect(const SkDraw& draw, const SkRRect& outer,
CHECK_SHOULD_DRAW(draw, false);
GrPaint grPaint;
- SkPaint2GrPaintShader(this, paint, true, &grPaint);
+ SkPaint2GrPaintShader(this->context(), paint, true, &grPaint);
if (NULL == paint.getMaskFilter() && NULL == paint.getPathEffect()) {
fContext->drawDRRect(grPaint, outer, inner);
@@ -601,7 +601,7 @@ void SkGpuDevice::drawOval(const SkDraw& draw, const SkRect& oval,
}
GrPaint grPaint;
- SkPaint2GrPaintShader(this, paint, true, &grPaint);
+ SkPaint2GrPaintShader(this->context(), paint, true, &grPaint);
SkStrokeRec stroke(paint);
fContext->drawOval(grPaint, oval, stroke);
@@ -752,7 +752,7 @@ void SkGpuDevice::drawPath(const SkDraw& draw, const SkPath& origSrcPath,
CHECK_SHOULD_DRAW(draw, false);
GrPaint grPaint;
- SkPaint2GrPaintShader(this, paint, true, &grPaint);
+ SkPaint2GrPaintShader(this->context(), paint, true, &grPaint);
// If we have a prematrix, apply it to the path, optimizing for the case
// where the original path can in fact be modified in place (even though
@@ -1400,7 +1400,7 @@ void SkGpuDevice::internalDrawBitmap(const SkBitmap& bitmap,
GrPaint grPaint;
grPaint.addColorEffect(effect);
bool alphaOnly = !(SkBitmap::kA8_Config == bitmap.config());
- SkPaint2GrPaintNoShader(this, paint, alphaOnly, false, &grPaint);
+ SkPaint2GrPaintNoShader(this->context(), paint, alphaOnly, false, &grPaint);
fContext->drawRectToRect(grPaint, dstRect, paintRect, NULL);
}
@@ -1466,7 +1466,7 @@ void SkGpuDevice::drawSprite(const SkDraw& draw, const SkBitmap& bitmap,
GrPaint grPaint;
grPaint.addColorTextureEffect(texture, SkMatrix::I());
- SkPaint2GrPaintNoShader(this, paint, true, false, &grPaint);
+ SkPaint2GrPaintNoShader(this->context(), paint, true, false, &grPaint);
fContext->drawRectToRect(grPaint,
SkRect::MakeXYWH(SkIntToScalar(left),
@@ -1574,7 +1574,7 @@ void SkGpuDevice::drawDevice(const SkDraw& draw, SkBaseDevice* device,
GrPaint grPaint;
grPaint.addColorTextureEffect(devTex, SkMatrix::I());
- SkPaint2GrPaintNoShader(this, paint, true, false, &grPaint);
+ SkPaint2GrPaintNoShader(this->context(), paint, true, false, &grPaint);
SkRect dstRect = SkRect::MakeXYWH(SkIntToScalar(x),
SkIntToScalar(y),
@@ -1635,9 +1635,9 @@ void SkGpuDevice::drawVertices(const SkDraw& draw, SkCanvas::VertexMode vmode,
GrPaint grPaint;
// we ignore the shader if texs is null.
if (NULL == texs) {
- SkPaint2GrPaintNoShader(this, paint, false, NULL == colors, &grPaint);
+ SkPaint2GrPaintNoShader(this->context(), paint, false, NULL == colors, &grPaint);
} else {
- SkPaint2GrPaintShader(this, paint, NULL == colors, &grPaint);
+ SkPaint2GrPaintShader(this->context(), paint, NULL == colors, &grPaint);
}
if (NULL != xmode && NULL != texs && NULL != colors) {
@@ -1677,14 +1677,14 @@ void SkGpuDevice::drawText(const SkDraw& draw, const void* text,
if (fMainTextContext->canDraw(paint)) {
GrPaint grPaint;
- SkPaint2GrPaintShader(this, paint, true, &grPaint);
+ SkPaint2GrPaintShader(this->context(), paint, true, &grPaint);
SkDEBUGCODE(this->validate();)
fMainTextContext->drawText(grPaint, paint, (const char *)text, byteLength, x, y);
} else if (fFallbackTextContext && fFallbackTextContext->canDraw(paint)) {
GrPaint grPaint;
- SkPaint2GrPaintShader(this, paint, true, &grPaint);
+ SkPaint2GrPaintShader(this->context(), paint, true, &grPaint);
SkDEBUGCODE(this->validate();)
@@ -1703,7 +1703,7 @@ void SkGpuDevice::drawPosText(const SkDraw& draw, const void* text,
if (fMainTextContext->canDraw(paint)) {
GrPaint grPaint;
- SkPaint2GrPaintShader(this, paint, true, &grPaint);
+ SkPaint2GrPaintShader(this->context(), paint, true, &grPaint);
SkDEBUGCODE(this->validate();)
@@ -1711,7 +1711,7 @@ void SkGpuDevice::drawPosText(const SkDraw& draw, const void* text,
constY, scalarsPerPos);
} else if (fFallbackTextContext && fFallbackTextContext->canDraw(paint)) {
GrPaint grPaint;
- SkPaint2GrPaintShader(this, paint, true, &grPaint);
+ SkPaint2GrPaintShader(this->context(), paint, true, &grPaint);
SkDEBUGCODE(this->validate();)
« no previous file with comments | « include/gpu/SkGr.h ('k') | src/gpu/SkGr.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698