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

Unified Diff: src/core/SkBlitter_A8.cpp

Issue 1164373003: Revert of change SkDraw and all Blitters to use pixmap instead of bitmap (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkBlitter.cpp ('k') | src/core/SkBlitter_ARGB32.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkBlitter_A8.cpp
diff --git a/src/core/SkBlitter_A8.cpp b/src/core/SkBlitter_A8.cpp
index ce7d6e7ad2ffc4eede2a8cc572c326ecaab90534..11f425903b99218e7522f50c26a0a281644b0542 100644
--- a/src/core/SkBlitter_A8.cpp
+++ b/src/core/SkBlitter_A8.cpp
@@ -12,11 +12,12 @@
#include "SkShader.h"
#include "SkXfermode.h"
-SkA8_Blitter::SkA8_Blitter(const SkPixmap& device, const SkPaint& paint) : INHERITED(device) {
+SkA8_Blitter::SkA8_Blitter(const SkBitmap& device, const SkPaint& paint)
+ : INHERITED(device) {
fSrcA = paint.getAlpha();
}
-const SkPixmap* SkA8_Blitter::justAnOpaqueColor(uint32_t* value) {
+const SkBitmap* SkA8_Blitter::justAnOpaqueColor(uint32_t* value) {
if (255 == fSrcA) {
*value = 255;
return &fDevice;
@@ -32,7 +33,7 @@
return;
}
- uint8_t* device = fDevice.writable_addr8(x, y);
+ uint8_t* device = fDevice.getAddr8(x, y);
if (fSrcA == 255) {
memset(device, 0xFF, width);
@@ -52,7 +53,7 @@
return;
}
- uint8_t* device = fDevice.writable_addr8(x, y);
+ uint8_t* device = fDevice.getAddr8(x, y);
unsigned srcA = fSrcA;
for (;;) {
@@ -96,7 +97,7 @@
#define SK_BLITBWMASK_NAME SkA8_BlitBW
#define SK_BLITBWMASK_ARGS
#define SK_BLITBWMASK_BLIT8(mask, dst) solid_8_pixels(mask, dst)
-#define SK_BLITBWMASK_GETADDR writable_addr8
+#define SK_BLITBWMASK_GETADDR getAddr8
#define SK_BLITBWMASK_DEVTYPE uint8_t
#include "SkBlitBWMaskTemplate.h"
@@ -115,7 +116,7 @@
#define SK_BLITBWMASK_NAME SkA8_BlendBW
#define SK_BLITBWMASK_ARGS , U8CPU sa, unsigned dst_scale
#define SK_BLITBWMASK_BLIT8(mask, dst) blend_8_pixels(mask, dst, sa, dst_scale)
-#define SK_BLITBWMASK_GETADDR writable_addr8
+#define SK_BLITBWMASK_GETADDR getAddr8
#define SK_BLITBWMASK_DEVTYPE uint8_t
#include "SkBlitBWMaskTemplate.h"
@@ -138,7 +139,7 @@
int y = clip.fTop;
int width = clip.width();
int height = clip.height();
- uint8_t* device = fDevice.writable_addr8(x, y);
+ uint8_t* device = fDevice.getAddr8(x, y);
const uint8_t* alpha = mask.getAddr8(x, y);
unsigned srcA = fSrcA;
@@ -178,7 +179,7 @@
}
unsigned sa = SkAlphaMul(fSrcA, SkAlpha255To256(alpha));
- uint8_t* device = fDevice.writable_addr8(x, y);
+ uint8_t* device = fDevice.getAddr8(x, y);
size_t rowBytes = fDevice.rowBytes();
if (sa == 0xFF) {
@@ -205,7 +206,7 @@
return;
}
- uint8_t* device = fDevice.writable_addr8(x, y);
+ uint8_t* device = fDevice.getAddr8(x, y);
unsigned srcA = fSrcA;
if (srcA == 255) {
@@ -227,10 +228,9 @@
///////////////////////////////////////////////////////////////////////
-SkA8_Shader_Blitter::SkA8_Shader_Blitter(const SkPixmap& device, const SkPaint& paint,
+SkA8_Shader_Blitter::SkA8_Shader_Blitter(const SkBitmap& device, const SkPaint& paint,
SkShader::Context* shaderContext)
- : INHERITED(device, paint, shaderContext)
-{
+ : INHERITED(device, paint, shaderContext) {
if ((fXfermode = paint.getXfermode()) != NULL) {
fXfermode->ref();
SkASSERT(fShaderContext);
@@ -250,7 +250,7 @@
SkASSERT(x >= 0 && y >= 0 &&
(unsigned)(x + width) <= (unsigned)fDevice.width());
- uint8_t* device = fDevice.writable_addr8(x, y);
+ uint8_t* device = fDevice.getAddr8(x, y);
SkShader::Context* shaderContext = fShaderContext;
if ((shaderContext->getFlags() & SkShader::kOpaqueAlpha_Flag) && !fXfermode) {
@@ -288,7 +288,7 @@
SkXfermode* mode = fXfermode;
uint8_t* aaExpand = fAAExpand;
SkPMColor* span = fBuffer;
- uint8_t* device = fDevice.writable_addr8(x, y);
+ uint8_t* device = fDevice.getAddr8(x, y);
int opaque = shaderContext->getFlags() & SkShader::kOpaqueAlpha_Flag;
for (;;) {
@@ -329,7 +329,7 @@
int y = clip.fTop;
int width = clip.width();
int height = clip.height();
- uint8_t* device = fDevice.writable_addr8(x, y);
+ uint8_t* device = fDevice.getAddr8(x, y);
const uint8_t* alpha = mask.getAddr8(x, y);
SkShader::Context* shaderContext = fShaderContext;
@@ -353,7 +353,7 @@
///////////////////////////////////////////////////////////////////////////////
-SkA8_Coverage_Blitter::SkA8_Coverage_Blitter(const SkPixmap& device,
+SkA8_Coverage_Blitter::SkA8_Coverage_Blitter(const SkBitmap& device,
const SkPaint& paint) : SkRasterBlitter(device) {
SkASSERT(NULL == paint.getShader());
SkASSERT(NULL == paint.getXfermode());
@@ -362,7 +362,7 @@
void SkA8_Coverage_Blitter::blitAntiH(int x, int y, const SkAlpha antialias[],
const int16_t runs[]) {
- uint8_t* device = fDevice.writable_addr8(x, y);
+ uint8_t* device = fDevice.getAddr8(x, y);
SkDEBUGCODE(int totalCount = 0;)
for (;;) {
@@ -384,7 +384,7 @@
}
void SkA8_Coverage_Blitter::blitH(int x, int y, int width) {
- memset(fDevice.writable_addr8(x, y), 0xFF, width);
+ memset(fDevice.getAddr8(x, y), 0xFF, width);
}
void SkA8_Coverage_Blitter::blitV(int x, int y, int height, SkAlpha alpha) {
@@ -392,7 +392,7 @@
return;
}
- uint8_t* dst = fDevice.writable_addr8(x, y);
+ uint8_t* dst = fDevice.getAddr8(x, y);
const size_t dstRB = fDevice.rowBytes();
while (--height >= 0) {
*dst = alpha;
@@ -401,7 +401,7 @@
}
void SkA8_Coverage_Blitter::blitRect(int x, int y, int width, int height) {
- uint8_t* dst = fDevice.writable_addr8(x, y);
+ uint8_t* dst = fDevice.getAddr8(x, y);
const size_t dstRB = fDevice.rowBytes();
while (--height >= 0) {
memset(dst, 0xFF, width);
@@ -417,7 +417,7 @@
int width = clip.width();
int height = clip.height();
- uint8_t* dst = fDevice.writable_addr8(x, y);
+ uint8_t* dst = fDevice.getAddr8(x, y);
const uint8_t* src = mask.getAddr8(x, y);
const size_t srcRB = mask.fRowBytes;
const size_t dstRB = fDevice.rowBytes();
@@ -429,6 +429,6 @@
}
}
-const SkPixmap* SkA8_Coverage_Blitter::justAnOpaqueColor(uint32_t*) {
+const SkBitmap* SkA8_Coverage_Blitter::justAnOpaqueColor(uint32_t*) {
return NULL;
}
« no previous file with comments | « src/core/SkBlitter.cpp ('k') | src/core/SkBlitter_ARGB32.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698