Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(333)

Unified Diff: src/gpu/SkGpuDevice.cpp

Issue 6818058: Gpu to apply mask gamma. Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 13 years ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/gpu/SkGpuDevice.cpp
===================================================================
--- src/gpu/SkGpuDevice.cpp (revision 6206)
+++ src/gpu/SkGpuDevice.cpp (working copy)
@@ -1784,6 +1784,18 @@
return fDrawProcs;
}
+struct MinimalRec {
+ SkScalar gamma;
+ SkScalar contrast;
+};
+
+static void GetRec(const SkDescriptor* desc, void* context) {
+ MinimalRec* minRec = static_cast<MinimalRec*>(context);
+ const SkScalerContext::Rec* rec = static_cast<const SkScalerContext::Rec*>(desc->findEntry(kRec_SkDescriptorTag, NULL));
+ minRec->gamma = rec->getDeviceGamma();
+ minRec->contrast = rec->getContrast();
+}
+
void SkGpuDevice::drawText(const SkDraw& draw, const void* text,
size_t byteLength, SkScalar x, SkScalar y,
const SkPaint& paint) {
@@ -1804,7 +1816,9 @@
&grPaint)) {
return;
}
reed1 2012/10/30 21:09:34 OK, now I'm sure we have too many bool params :)
- GrTextContext context(fContext, grPaint);
+ MinimalRec rec;
+ paint.descriptorProc(draw.fMatrix, GetRec, &rec, false, false);
+ GrTextContext context(fContext, grPaint, rec.gamma, rec.contrast);
myDraw.fProcs = this->initDrawForText(&context);
this->INHERITED::drawText(myDraw, text, byteLength, x, y, paint);
}
@@ -1832,7 +1846,9 @@
&grPaint)) {
return;
}
- GrTextContext context(fContext, grPaint);
+ MinimalRec rec;
+ paint.descriptorProc(draw.fMatrix, GetRec, &rec, false, false);
+ GrTextContext context(fContext, grPaint, rec.gamma, rec.contrast);
myDraw.fProcs = this->initDrawForText(&context);
this->INHERITED::drawPosText(myDraw, text, byteLength, pos, constY,
scalarsPerPos, paint);

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b