From 879a252d090a0929c11d8963dbd4328b11d0916f Mon Sep 17 00:00:00 2001 From: "reed@android.com" Date: Mon, 26 Oct 2009 19:15:43 +0000 Subject: 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 --- src/core/SkBitmapProcShader.cpp | 23 ----------------------- src/core/SkBitmapProcState_filter.h | 9 +++++++++ src/utils/mac/SkOSWindow_Mac.cpp | 2 +- 3 files changed, 10 insertions(+), 24 deletions(-) (limited to 'src') 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: -- cgit v1.2.3