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

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

Issue 1143173011: use pixmaps for dst in sprites -- NO BITMAPS (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add dox 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/SkSpriteBlitter.h ('k') | src/core/SkSpriteBlitter_ARGB32.cpp » ('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 * Copyright 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 class SkSPRITE_CLASSNAME : public SkSpriteBlitter { 8 class SkSPRITE_CLASSNAME : public SkSpriteBlitter {
9 public: 9 public:
10 SkSPRITE_CLASSNAME(const SkPixmap& source SkSPRITE_ARGS) : SkSpriteBlitter(s ource) { 10 SkSPRITE_CLASSNAME(const SkPixmap& source SkSPRITE_ARGS) : SkSpriteBlitter(s ource) {
11 SkSPRITE_INIT 11 SkSPRITE_INIT
12 } 12 }
13 13
14 virtual void blitRect(int x, int y, int width, int height) { 14 virtual void blitRect(int x, int y, int width, int height) {
15 SkASSERT(width > 0 && height > 0); 15 SkASSERT(width > 0 && height > 0);
16 int srcX = x - fLeft; 16 int srcX = x - fLeft;
17 int srcY = y - fTop; 17 int srcY = y - fTop;
18 SkSPRITE_DST_TYPE* SK_RESTRICT dst =fDevice->SkSPRITE_DST_GETADDR(x, y); 18 SkSPRITE_DST_TYPE* SK_RESTRICT dst =fDst.SkSPRITE_DST_GETADDR(x, y);
19 const SkSPRITE_SRC_TYPE* SK_RESTRICT src = fSource.SkSPRITE_SRC_GETADDR( srcX, srcY); 19 const SkSPRITE_SRC_TYPE* SK_RESTRICT src = fSource.SkSPRITE_SRC_GETADDR( srcX, srcY);
20 size_t dstRB = fDevice->rowBytes(); 20 size_t dstRB = fDst.rowBytes();
21 size_t srcRB = fSource.rowBytes(); 21 size_t srcRB = fSource.rowBytes();
22 22
23 SkDEBUGCODE((void)fDevice->SkSPRITE_DST_GETADDR(x + width - 1, y + heigh t - 1);) 23 SkDEBUGCODE((void)fDst.SkSPRITE_DST_GETADDR(x + width - 1, y + height - 1);)
24 SkDEBUGCODE((void)fSource.SkSPRITE_SRC_GETADDR(srcX + width - 1, srcY + height - 1);) 24 SkDEBUGCODE((void)fSource.SkSPRITE_SRC_GETADDR(srcX + width - 1, srcY + height - 1);)
25 25
26 SkSPRITE_PREAMBLE(fSource, srcX, srcY); 26 SkSPRITE_PREAMBLE(fSource, srcX, srcY);
27 27
28 do { 28 do {
29 SkSPRITE_DST_TYPE* d = dst; 29 SkSPRITE_DST_TYPE* d = dst;
30 const SkSPRITE_SRC_TYPE* s = src; 30 const SkSPRITE_SRC_TYPE* s = src;
31 #ifdef SkSPRITE_BEGIN_ROW 31 #ifdef SkSPRITE_BEGIN_ROW
32 SkSPRITE_BEGIN_ROW 32 SkSPRITE_BEGIN_ROW
33 #endif 33 #endif
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 #undef SkSPRITE_POSTAMBLE 67 #undef SkSPRITE_POSTAMBLE
68 #undef SkSPRITE_ARGS 68 #undef SkSPRITE_ARGS
69 #undef SkSPRITE_FIELDS 69 #undef SkSPRITE_FIELDS
70 #undef SkSPRITE_INIT 70 #undef SkSPRITE_INIT
71 #undef SkSPRITE_NEXT_ROW 71 #undef SkSPRITE_NEXT_ROW
72 #undef SkSPRITE_BEGIN_ROW 72 #undef SkSPRITE_BEGIN_ROW
73 73
74 #ifdef SkSPRITE_ROW_PROC 74 #ifdef SkSPRITE_ROW_PROC
75 #undef SkSPRITE_ROW_PROC 75 #undef SkSPRITE_ROW_PROC
76 #endif 76 #endif
OLDNEW
« no previous file with comments | « src/core/SkSpriteBlitter.h ('k') | src/core/SkSpriteBlitter_ARGB32.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698