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

Unified Diff: src/gpu/SkGpuDevice.cpp

Issue 318923005: SkShader::asNewEffect Refactoring (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: added macros to check for gpu support Created 6 years, 6 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 | « src/effects/gradients/SkTwoPointRadialGradient.cpp ('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 44120a220f7ab84f3b2e16eca5326fdb61dba851..15539a9dcf069620f37a297558e78378f18b27a9 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -1356,7 +1356,9 @@ void SkGpuDevice::internalDrawBitmap(const SkBitmap& bitmap,
GrPaint grPaint;
grPaint.addColorEffect(effect);
bool alphaOnly = !(SkBitmap::kA8_Config == bitmap.config());
- SkPaint2GrPaintNoShader(this->context(), paint, alphaOnly, false, &grPaint);
+ GrColor grColor = (alphaOnly) ? SkColor2GrColorJustAlpha(paint.getColor()) :
+ SkColor2GrColor(paint.getColor());
+ SkPaint2GrPaintNoShader(this->context(), paint, grColor, false, &grPaint);
fContext->drawRectToRect(grPaint, dstRect, paintRect, NULL);
}
@@ -1422,7 +1424,8 @@ void SkGpuDevice::drawSprite(const SkDraw& draw, const SkBitmap& bitmap,
GrPaint grPaint;
grPaint.addColorTextureEffect(texture, SkMatrix::I());
- SkPaint2GrPaintNoShader(this->context(), paint, true, false, &grPaint);
+ SkPaint2GrPaintNoShader(this->context(), paint, SkColor2GrColorJustAlpha(paint.getColor()),
+ false, &grPaint);
fContext->drawRectToRect(grPaint,
SkRect::MakeXYWH(SkIntToScalar(left),
@@ -1530,7 +1533,8 @@ void SkGpuDevice::drawDevice(const SkDraw& draw, SkBaseDevice* device,
GrPaint grPaint;
grPaint.addColorTextureEffect(devTex, SkMatrix::I());
- SkPaint2GrPaintNoShader(this->context(), paint, true, false, &grPaint);
+ SkPaint2GrPaintNoShader(this->context(), paint, SkColor2GrColorJustAlpha(paint.getColor()),
+ false, &grPaint);
SkRect dstRect = SkRect::MakeXYWH(SkIntToScalar(x),
SkIntToScalar(y),
@@ -1616,7 +1620,8 @@ void SkGpuDevice::drawVertices(const SkDraw& draw, SkCanvas::VertexMode vmode,
GrPaint grPaint;
// we ignore the shader if texs is null.
if (NULL == texs) {
- SkPaint2GrPaintNoShader(this->context(), paint, false, NULL == colors, &grPaint);
+ SkPaint2GrPaintNoShader(this->context(), paint, SkColor2GrColor(paint.getColor()),
+ NULL == colors, &grPaint);
} else {
SkPaint2GrPaintShader(this->context(), paint, NULL == colors, &grPaint);
}
« no previous file with comments | « src/effects/gradients/SkTwoPointRadialGradient.cpp ('k') | src/gpu/SkGr.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698