aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/SkBlitRow_D32.cpp20
-rw-r--r--src/core/SkBlitter_ARGB32.cpp13
-rw-r--r--src/core/SkCoreBlitters.h1
3 files changed, 30 insertions, 4 deletions
diff --git a/src/core/SkBlitRow_D32.cpp b/src/core/SkBlitRow_D32.cpp
index 97aa665cb9..f1bf0ca1e1 100644
--- a/src/core/SkBlitRow_D32.cpp
+++ b/src/core/SkBlitRow_D32.cpp
@@ -12,6 +12,8 @@
#define UNROLL
+SkBlitRow::ColorRectProc PlatformColorRectProcFactory();
+
static void S32_Opaque_BlitRow32(SkPMColor* SK_RESTRICT dst,
const SkPMColor* SK_RESTRICT src,
int count, U8CPU alpha) {
@@ -178,3 +180,21 @@ void SkBlitRow::Color32(SkPMColor* SK_RESTRICT dst,
}
}
+void SkBlitRow::ColorRect32(SkPMColor* dst, int width, int height,
+ size_t rowBytes, SkPMColor color) {
+ SkBlitRow::ColorProc proc = SkBlitRow::ColorProcFactory();
+ while (--height >= 0) {
+ (*proc)(dst, dst, width, color);
+ dst = (SkPMColor*) ((char*)dst + rowBytes);
+ }
+}
+
+SkBlitRow::ColorRectProc SkBlitRow::ColorRectProcFactory() {
+ SkBlitRow::ColorRectProc proc = PlatformColorRectProcFactory();
+ if (NULL == proc) {
+ proc = ColorRect32;
+ }
+ SkASSERT(proc);
+ return proc;
+}
+
diff --git a/src/core/SkBlitter_ARGB32.cpp b/src/core/SkBlitter_ARGB32.cpp
index 24ab330769..977c961583 100644
--- a/src/core/SkBlitter_ARGB32.cpp
+++ b/src/core/SkBlitter_ARGB32.cpp
@@ -53,6 +53,7 @@ SkARGB32_Blitter::SkARGB32_Blitter(const SkBitmap& device, const SkPaint& paint)
fPMColor = SkPackARGB32(fSrcA, fSrcR, fSrcG, fSrcB);
fColor32Proc = SkBlitRow::ColorProcFactory();
+ fColorRect32Proc = SkBlitRow::ColorRectProcFactory();
}
const SkBitmap* SkARGB32_Blitter::justAnOpaqueColor(uint32_t* value) {
@@ -213,10 +214,14 @@ void SkARGB32_Blitter::blitRect(int x, int y, int width, int height) {
uint32_t color = fPMColor;
size_t rowBytes = fDevice.rowBytes();
- while (--height >= 0) {
- fColor32Proc(device, device, width, color);
- device = (uint32_t*)((char*)device + rowBytes);
- }
+ //if (255 == SkGetPackedA32(color)) {
+ fColorRect32Proc(device, width, height, rowBytes, color);
+ //} else {
+ //while (--height >= 0) {
+ //fColor32Proc(device, device, width, color);
+ //device = (uint32_t*)((char*)device + rowBytes);
+ //}
+ //}
}
#if defined _WIN32 && _MSC_VER >= 1300
diff --git a/src/core/SkCoreBlitters.h b/src/core/SkCoreBlitters.h
index 4947198bcd..4a03a53169 100644
--- a/src/core/SkCoreBlitters.h
+++ b/src/core/SkCoreBlitters.h
@@ -94,6 +94,7 @@ protected:
SkColor fColor;
SkPMColor fPMColor;
SkBlitRow::ColorProc fColor32Proc;
+ SkBlitRow::ColorRectProc fColorRect32Proc;
private:
unsigned fSrcA, fSrcR, fSrcG, fSrcB;