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

Unified Diff: samplecode/SampleUnpremul.cpp

Issue 16816016: Fix for PNG, coding style, skip opaque. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 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 | « no previous file | src/images/SkImageDecoder_libpng.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleUnpremul.cpp
diff --git a/samplecode/SampleUnpremul.cpp b/samplecode/SampleUnpremul.cpp
index c6244cf042d00f223a0cb0bdccb47e9506508373..dfdd2accdbcd2466cf1e3de20cf24f943cd59981 100644
--- a/samplecode/SampleUnpremul.cpp
+++ b/samplecode/SampleUnpremul.cpp
@@ -28,7 +28,7 @@ extern SkShader* createChecker();
* Interprets c as an unpremultiplied color, and returns the
* premultiplied equivalent.
*/
-SkPMColor SkPreMultiplyUnPMColor(SkPMColor c) {
+static SkPMColor premultiply_unpmcolor(SkPMColor c) {
U8CPU a = SkGetPackedA32(c);
U8CPU r = SkGetPackedR32(c);
U8CPU g = SkGetPackedG32(c);
@@ -132,7 +132,7 @@ protected:
}
for (int i = 0; i < fBitmap.width(); ++i) {
for (int j = 0; j < fBitmap.height(); ++j) {
- *bm.getAddr32(i, j) = SkPreMultiplyUnPMColor(*fBitmap.getAddr32(i, j));
+ *bm.getAddr32(i, j) = premultiply_unpmcolor(*fBitmap.getAddr32(i, j));
}
}
canvas->drawBitmap(bm, 0, 0);
« no previous file with comments | « no previous file | src/images/SkImageDecoder_libpng.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698