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

Unified Diff: src/core/SkBlitMask_D32.cpp

Issue 1534243002: Revert of Fix UB function problems for shaders and mask. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years 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/core/SkBlitMask.h ('k') | src/core/SkBlitter_ARGB32.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkBlitMask_D32.cpp
diff --git a/src/core/SkBlitMask_D32.cpp b/src/core/SkBlitMask_D32.cpp
index 5a1ad2813e0f1c1a064ce8ec67b7d9d2f455769c..3cc791af4ed63417f2905a33fe6051e9ed63a46c 100644
--- a/src/core/SkBlitMask_D32.cpp
+++ b/src/core/SkBlitMask_D32.cpp
@@ -76,9 +76,9 @@
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
-static void BW_RowProc_Blend(
- SkPMColor* SK_RESTRICT dst, const void* maskIn, const SkPMColor* SK_RESTRICT src, int count) {
- const uint8_t* SK_RESTRICT mask = static_cast<const uint8_t*>(maskIn);
+static void BW_RowProc_Blend(SkPMColor* SK_RESTRICT dst,
+ const uint8_t* SK_RESTRICT mask,
+ const SkPMColor* SK_RESTRICT src, int count) {
int i, octuple = (count + 7) >> 3;
for (i = 0; i < octuple; ++i) {
int m = *mask++;
@@ -105,9 +105,9 @@
}
}
-static void BW_RowProc_Opaque(
- SkPMColor* SK_RESTRICT dst, const void* maskIn, const SkPMColor* SK_RESTRICT src, int count) {
- const uint8_t* SK_RESTRICT mask = static_cast<const uint8_t*>(maskIn);
+static void BW_RowProc_Opaque(SkPMColor* SK_RESTRICT dst,
+ const uint8_t* SK_RESTRICT mask,
+ const SkPMColor* SK_RESTRICT src, int count) {
int i, octuple = (count + 7) >> 3;
for (i = 0; i < octuple; ++i) {
int m = *mask++;
@@ -134,9 +134,9 @@
}
}
-static void A8_RowProc_Blend(
- SkPMColor* SK_RESTRICT dst, const void* maskIn, const SkPMColor* SK_RESTRICT src, int count) {
- const uint8_t* SK_RESTRICT mask = static_cast<const uint8_t*>(maskIn);
+static void A8_RowProc_Blend(SkPMColor* SK_RESTRICT dst,
+ const uint8_t* SK_RESTRICT mask,
+ const SkPMColor* SK_RESTRICT src, int count) {
for (int i = 0; i < count; ++i) {
if (mask[i]) {
dst[i] = SkBlendARGB32(src[i], dst[i], mask[i]);
@@ -153,9 +153,9 @@
#define EXPAND1(v, m, s) (((v) >> 8) & (m)) * (s)
#define COMBINE(e0, e1, m) ((((e0) >> 8) & (m)) | ((e1) & ~(m)))
-static void A8_RowProc_Opaque(
- SkPMColor* SK_RESTRICT dst, const void* maskIn, const SkPMColor* SK_RESTRICT src, int count) {
- const uint8_t* SK_RESTRICT mask = static_cast<const uint8_t*>(maskIn);
+static void A8_RowProc_Opaque(SkPMColor* SK_RESTRICT dst,
+ const uint8_t* SK_RESTRICT mask,
+ const SkPMColor* SK_RESTRICT src, int count) {
for (int i = 0; i < count; ++i) {
int m = mask[i];
if (m) {
@@ -188,9 +188,9 @@
return dst + SkAlphaMul(src - SkAlphaMul(srcA, dst), mask);
}
-static void LCD16_RowProc_Blend(
- SkPMColor* SK_RESTRICT dst, const void* maskIn, const SkPMColor* SK_RESTRICT src, int count) {
- const uint8_t* SK_RESTRICT mask = static_cast<const uint8_t*>(maskIn);
+static void LCD16_RowProc_Blend(SkPMColor* SK_RESTRICT dst,
+ const uint16_t* SK_RESTRICT mask,
+ const SkPMColor* SK_RESTRICT src, int count) {
for (int i = 0; i < count; ++i) {
uint16_t m = mask[i];
if (0 == m) {
@@ -231,9 +231,9 @@
}
}
-static void LCD16_RowProc_Opaque(
- SkPMColor* SK_RESTRICT dst, const void* maskIn, const SkPMColor* SK_RESTRICT src, int count) {
- const uint8_t* SK_RESTRICT mask = static_cast<const uint8_t*>(maskIn);
+static void LCD16_RowProc_Opaque(SkPMColor* SK_RESTRICT dst,
+ const uint16_t* SK_RESTRICT mask,
+ const SkPMColor* SK_RESTRICT src, int count) {
for (int i = 0; i < count; ++i) {
uint16_t m = mask[i];
if (0 == m) {
« no previous file with comments | « src/core/SkBlitMask.h ('k') | src/core/SkBlitter_ARGB32.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698