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

Side by Side Diff: src/core/SkBlitBWMaskTemplate.h

Issue 1148793007: change SkDraw and all Blitters to use pixmap instead of bitmap (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 5 years, 6 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 unified diff | Download patch
« no previous file with comments | « src/core/SkAAClip.cpp ('k') | src/core/SkBlitMask.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
11 #include "SkMask.h" 11 #include "SkMask.h"
12 12
13 #ifndef ClearLow3Bits_DEFINED 13 #ifndef ClearLow3Bits_DEFINED
14 #define ClearLow3Bits_DEFINED 14 #define ClearLow3Bits_DEFINED
15 #define ClearLow3Bits(x) ((unsigned)(x) >> 3 << 3) 15 #define ClearLow3Bits(x) ((unsigned)(x) >> 3 << 3)
16 #endif 16 #endif
17 17
18 /* 18 /*
19 SK_BLITBWMASK_NAME name of function(const SkBitmap& bitmap, const S kMask& mask, const SkIRect& clip, SK_BLITBWMASK_ARGS) 19 SK_BLITBWMASK_NAME name of function(const SkBitmap& bitmap, const S kMask& mask, const SkIRect& clip, SK_BLITBWMASK_ARGS)
20 SK_BLITBWMASK_ARGS list of additional arguments to SK_BLITBWMASK_NA ME, beginning with a comma 20 SK_BLITBWMASK_ARGS list of additional arguments to SK_BLITBWMASK_NA ME, beginning with a comma
21 SK_BLITBWMASK_BLIT8 name of function(U8CPU byteMask, SK_BLITBWMASK_D EVTYPE* dst, int x, int y) 21 SK_BLITBWMASK_BLIT8 name of function(U8CPU byteMask, SK_BLITBWMASK_D EVTYPE* dst, int x, int y)
22 SK_BLITBWMASK_GETADDR either getAddr32 or getAddr16 or getAddr8 22 SK_BLITBWMASK_GETADDR either writable_addr[8,16,32]
23 SK_BLITBWMASK_DEVTYPE either U32 or U16 or U8 23 SK_BLITBWMASK_DEVTYPE either U32 or U16 or U8
24 */ 24 */
25 25
26 static void SK_BLITBWMASK_NAME(const SkBitmap& bitmap, const SkMask& srcMask, co nst SkIRect& clip SK_BLITBWMASK_ARGS) 26 static void SK_BLITBWMASK_NAME(const SkPixmap& dst, const SkMask& srcMask,
27 { 27 const SkIRect& clip SK_BLITBWMASK_ARGS) {
28 SkASSERT(clip.fRight <= srcMask.fBounds.fRight); 28 SkASSERT(clip.fRight <= srcMask.fBounds.fRight);
29 29
30 int cx = clip.fLeft; 30 int cx = clip.fLeft;
31 int cy = clip.fTop; 31 int cy = clip.fTop;
32 int maskLeft = srcMask.fBounds.fLeft; 32 int maskLeft = srcMask.fBounds.fLeft;
33 unsigned mask_rowBytes = srcMask.fRowBytes; 33 unsigned mask_rowBytes = srcMask.fRowBytes;
34 size_t bitmap_rowBytes = bitmap.rowBytes(); 34 size_t bitmap_rowBytes = dst.rowBytes();
35 unsigned height = clip.height(); 35 unsigned height = clip.height();
36 36
37 SkASSERT(mask_rowBytes != 0); 37 SkASSERT(mask_rowBytes != 0);
38 SkASSERT(bitmap_rowBytes != 0); 38 SkASSERT(bitmap_rowBytes != 0);
39 SkASSERT(height != 0); 39 SkASSERT(height != 0);
40 40
41 const uint8_t* bits = srcMask.getAddr1(cx, cy); 41 const uint8_t* bits = srcMask.getAddr1(cx, cy);
42 SK_BLITBWMASK_DEVTYPE* device = bitmap.SK_BLITBWMASK_GETADDR(cx, cy); 42 SK_BLITBWMASK_DEVTYPE* device = dst.SK_BLITBWMASK_GETADDR(cx, cy);
43 43
44 if (cx == maskLeft && clip.fRight == srcMask.fBounds.fRight) 44 if (cx == maskLeft && clip.fRight == srcMask.fBounds.fRight)
45 { 45 {
46 do { 46 do {
47 SK_BLITBWMASK_DEVTYPE* dst = device; 47 SK_BLITBWMASK_DEVTYPE* dst = device;
48 unsigned rb = mask_rowBytes; 48 unsigned rb = mask_rowBytes;
49 do { 49 do {
50 U8CPU mask = *bits++; 50 U8CPU mask = *bits++;
51 SK_BLITBWMASK_BLIT8(mask, dst); 51 SK_BLITBWMASK_BLIT8(mask, dst);
52 dst += 8; 52 dst += 8;
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 } 119 }
120 } 120 }
121 } 121 }
122 122
123 #undef SK_BLITBWMASK_NAME 123 #undef SK_BLITBWMASK_NAME
124 #undef SK_BLITBWMASK_ARGS 124 #undef SK_BLITBWMASK_ARGS
125 #undef SK_BLITBWMASK_BLIT8 125 #undef SK_BLITBWMASK_BLIT8
126 #undef SK_BLITBWMASK_GETADDR 126 #undef SK_BLITBWMASK_GETADDR
127 #undef SK_BLITBWMASK_DEVTYPE 127 #undef SK_BLITBWMASK_DEVTYPE
128 #undef SK_BLITBWMASK_DOROWSETUP 128 #undef SK_BLITBWMASK_DOROWSETUP
OLDNEW
« no previous file with comments | « src/core/SkAAClip.cpp ('k') | src/core/SkBlitMask.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698