aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2009-10-26 19:15:43 +0000
committerGravatar reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2009-10-26 19:15:43 +0000
commit879a252d090a0929c11d8963dbd4328b11d0916f (patch)
treedbbb91534ca8f07f7df9dfe1edae706056d0ae14 /src
parent522aa8d4d61f30bddbaf996b2933d5f7b1f23880 (diff)
remove check for filtering. Now if the src is opaque, the filtered result
always will be too. git-svn-id: http://skia.googlecode.com/svn/trunk@406 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src')
-rw-r--r--src/core/SkBitmapProcShader.cpp23
-rw-r--r--src/core/SkBitmapProcState_filter.h9
-rw-r--r--src/utils/mac/SkOSWindow_Mac.cpp2
3 files changed, 10 insertions, 24 deletions
diff --git a/src/core/SkBitmapProcShader.cpp b/src/core/SkBitmapProcShader.cpp
index 6685397871..bd4fece96b 100644
--- a/src/core/SkBitmapProcShader.cpp
+++ b/src/core/SkBitmapProcShader.cpp
@@ -72,13 +72,6 @@ static bool only_scale_and_translate(const SkMatrix& matrix) {
return (matrix.getType() & ~mask) == 0;
}
-// return true if the config can possibly have per-pixel alpha, ignoring the
-// current setting of isOpaque.
-static bool canSupportPerPixelAlpha(const SkBitmap& bm) {
- // return true unless we're guaranteed to be opaque
- return bm.config() != SkBitmap::kRGB_565_Config;
-}
-
bool SkBitmapProcShader::setContext(const SkBitmap& device,
const SkPaint& paint,
const SkMatrix& matrix) {
@@ -101,22 +94,6 @@ bool SkBitmapProcShader::setContext(const SkBitmap& device,
const SkBitmap& bitmap = *fState.fBitmap;
bool bitmapIsOpaque = bitmap.isOpaque();
- // filtering doesn't guarantee that opaque stays opaque (finite precision)
- // so pretend we're not opaque if we're being asked to filter. If we had
- // more blit-procs, we could specialize on opaque src, and just OR in 0xFF
- // after the filter to be sure...
- /*
- (some time later)
- Adding check for canSupportPerPixelAlpha, since bitmaps that are 565
- (for example) will *always* be opaque, even after filtering.
-
- Would be really nice to never do this, if we could ensure that
- filtering didn't introduct non-opaqueness accidentally.
- */
- if (paint.isFilterBitmap() && canSupportPerPixelAlpha(bitmap)) {
- bitmapIsOpaque = false;
- }
-
// update fFlags
uint32_t flags = 0;
if (bitmapIsOpaque && (255 == this->getPaintAlpha())) {
diff --git a/src/core/SkBitmapProcState_filter.h b/src/core/SkBitmapProcState_filter.h
index 706ff7d25d..bb9625a4ca 100644
--- a/src/core/SkBitmapProcState_filter.h
+++ b/src/core/SkBitmapProcState_filter.h
@@ -19,6 +19,15 @@
#endif
#include "SkColorPriv.h"
+/*
+ Filter_32_opaque
+
+ There is no hard-n-fast rule that the filtering must produce
+ exact results for the color components, but if the 4 incoming colors are
+ all opaque, then the output color must also be opaque. Subsequent parts of
+ the drawing pipeline may rely on this (e.g. which blitrow proc to use).
+ */
+
#if defined(__ARM_HAVE_NEON) && !defined(SK_CPU_BENDIAN)
static inline void Filter_32_opaque_neon(unsigned x, unsigned y,
SkPMColor a00, SkPMColor a01,
diff --git a/src/utils/mac/SkOSWindow_Mac.cpp b/src/utils/mac/SkOSWindow_Mac.cpp
index c2537b92f3..eb07e2aa73 100644
--- a/src/utils/mac/SkOSWindow_Mac.cpp
+++ b/src/utils/mac/SkOSWindow_Mac.cpp
@@ -329,7 +329,7 @@ pascal OSStatus SkOSWindow::EventHandler( EventHandlerCallRef inHandler, EventRe
switch (wKind) {
case kEventMouseDown:
if (win->handleClick(pt.h, pt.v, Click::kDown_State)) {
- // result = noErr;
+ result = noErr;
}
break;
case kEventMouseDragged: