remove check for filtering. Now if the src is opaque, the filtered result
authorreed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Mon, 26 Oct 2009 19:15:43 +0000 (19:15 +0000)
committerreed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Mon, 26 Oct 2009 19:15:43 +0000 (19:15 +0000)
always will be too.

git-svn-id: http://skia.googlecode.com/svn/trunk@406 2bbb7eff-a529-9590-31e7-b0007b416f81

src/core/SkBitmapProcShader.cpp
src/core/SkBitmapProcState_filter.h
src/utils/mac/SkOSWindow_Mac.cpp

index 6685397..bd4fece 100644 (file)
@@ -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())) {
index 706ff7d..bb9625a 100644 (file)
 #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,
index c2537b9..eb07e2a 100644 (file)
@@ -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: