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

Unified Diff: skia/sgl/SkBitmapProcState_matrix.h

Issue 20386: Fix the Facebook sidebar.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 10 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 | « skia/sgl/SkBitmapProcState.cpp ('k') | skia/sgl/SkBitmapProcState_matrixProcs.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/sgl/SkBitmapProcState_matrix.h
===================================================================
--- skia/sgl/SkBitmapProcState_matrix.h (revision 9831)
+++ skia/sgl/SkBitmapProcState_matrix.h (working copy)
@@ -1,4 +1,5 @@
+#define TRANSLATE_NOFILTER_NAME MAKENAME(_nofilter_translate)
#define SCALE_NOFILTER_NAME MAKENAME(_nofilter_scale)
#define SCALE_FILTER_NAME MAKENAME(_filter_scale)
#define AFFINE_NOFILTER_NAME MAKENAME(_nofilter_affine)
@@ -17,6 +18,38 @@
#define PREAMBLE_ARG_Y
#endif
+#ifndef PREAMBLE_TRANS
+ #define PREAMBLE_TRANS(state)
+#endif
+
+static void TRANSLATE_NOFILTER_NAME(const SkBitmapProcState& s,
+ uint32_t xy[], int count, int x, int y)
+{
+ SkASSERT((s.fInvType & ~SkMatrix::kTranslate_Mask) == 0);
+
+ PREAMBLE_TRANS(s);
+
+ x += SkScalarFloor(s.fInvMatrix->getTranslateX());
+ y += SkScalarFloor(s.fInvMatrix->getTranslateY());
+
+ *xy++ = (uint32_t)TILEY_TRANS(y, (s.fBitmap->height() - 1));
+
+ unsigned maxX = s.fBitmap->width() - 1;
+ int i;
+ uint16_t* xx = (uint16_t*)xy;
+ for (i = (count >> 2); i > 0; --i)
+ {
+ *xx++ = (uint16_t)TILEX_TRANS(x, maxX); x++;
+ *xx++ = (uint16_t)TILEX_TRANS(x, maxX); x++;
+ *xx++ = (uint16_t)TILEX_TRANS(x, maxX); x++;
+ *xx++ = (uint16_t)TILEX_TRANS(x, maxX); x++;
+ }
+ for (i = (count & 3); i > 0; --i)
+ {
+ *xx++ = (uint16_t)TILEX_TRANS(x, maxX); x++;
+ }
+}
+
static void SCALE_NOFILTER_NAME(const SkBitmapProcState& s,
uint32_t xy[], int count, int x, int y) {
SkASSERT((s.fInvType & ~(SkMatrix::kTranslate_Mask |
@@ -241,6 +274,9 @@
}
static SkBitmapProcState::MatrixProc MAKENAME(_Procs)[] = {
+ TRANSLATE_NOFILTER_NAME,
+ TRANSLATE_NOFILTER_NAME, // No need to do filtering if the matrix is no
+ // more complex than identity/translate.
SCALE_NOFILTER_NAME,
SCALE_FILTER_NAME,
AFFINE_NOFILTER_NAME,
@@ -256,6 +292,10 @@
#undef CHECK_FOR_DECAL
#endif
+#undef TILEX_TRANS
+#undef TILEY_TRANS
+
+#undef TRANSLATE_NOFILTER_NAME
#undef SCALE_NOFILTER_NAME
#undef SCALE_FILTER_NAME
#undef AFFINE_NOFILTER_NAME
@@ -269,5 +309,7 @@
#undef PREAMBLE_ARG_X
#undef PREAMBLE_ARG_Y
+#undef PREAMBLE_TRANS
+
#undef TILEX_LOW_BITS
#undef TILEY_LOW_BITS
« no previous file with comments | « skia/sgl/SkBitmapProcState.cpp ('k') | skia/sgl/SkBitmapProcState_matrixProcs.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698