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

Unified Diff: src/opts/SkBlitRow_opts_SSE2.cpp

Issue 1278253003: Sk4px blit mask. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: note overflow Created 5 years, 4 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/opts/SkBlitRow_opts_SSE2.h ('k') | src/opts/SkOpts_neon.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/opts/SkBlitRow_opts_SSE2.cpp
diff --git a/src/opts/SkBlitRow_opts_SSE2.cpp b/src/opts/SkBlitRow_opts_SSE2.cpp
index 7f5b6779cf2d3d4a53d1d201ae3d1888b12cd31f..c017f7e4b3d1496f950e00f738dc30588226ecf9 100644
--- a/src/opts/SkBlitRow_opts_SSE2.cpp
+++ b/src/opts/SkBlitRow_opts_SSE2.cpp
@@ -301,54 +301,6 @@ void Color32A_D565_SSE2(uint16_t dst[], SkPMColor src, int count, int x, int y)
}
}
-void SkARGB32_A8_BlitMask_SSE2(void* device, size_t dstRB, const void* maskPtr,
- size_t maskRB, SkColor origColor,
- int width, int height) {
- SkPMColor color = SkPreMultiplyColor(origColor);
- size_t dstOffset = dstRB - (width << 2);
- size_t maskOffset = maskRB - width;
- SkPMColor* dst = (SkPMColor *)device;
- const uint8_t* mask = (const uint8_t*)maskPtr;
- do {
- int count = width;
- if (count >= 4) {
- while (((size_t)dst & 0x0F) != 0 && (count > 0)) {
- *dst = SkBlendARGB32(color, *dst, *mask);
- mask++;
- dst++;
- count--;
- }
- __m128i *d = reinterpret_cast<__m128i*>(dst);
- __m128i src_pixel = _mm_set1_epi32(color);
- while (count >= 4) {
- // Load 4 dst pixels
- __m128i dst_pixel = _mm_load_si128(d);
-
- // Set the alpha value
- __m128i alpha_wide = _mm_cvtsi32_si128(*reinterpret_cast<const uint32_t*>(mask));
- alpha_wide = _mm_unpacklo_epi8(alpha_wide, _mm_setzero_si128());
- alpha_wide = _mm_unpacklo_epi16(alpha_wide, _mm_setzero_si128());
-
- __m128i result = SkBlendARGB32_SSE2(src_pixel, dst_pixel, alpha_wide);
- _mm_store_si128(d, result);
- // Load the next 4 dst pixels and alphas
- mask = mask + 4;
- d++;
- count -= 4;
- }
- dst = reinterpret_cast<SkPMColor*>(d);
- }
- while (count > 0) {
- *dst= SkBlendARGB32(color, *dst, *mask);
- dst += 1;
- mask++;
- count --;
- }
- dst = (SkPMColor *)((char*)dst + dstOffset);
- mask += maskOffset;
- } while (--height != 0);
-}
-
// The following (left) shifts cause the top 5 bits of the mask components to
// line up with the corresponding components in an SkPMColor.
// Note that the mask's RGB16 order may differ from the SkPMColor order.
« no previous file with comments | « src/opts/SkBlitRow_opts_SSE2.h ('k') | src/opts/SkOpts_neon.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698