зеркало из https://github.com/mozilla/moz-skia.git
remove remaining references to porterduff
git-svn-id: http://skia.googlecode.com/svn/trunk@236 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
Родитель
845fdaca17
Коммит
048522dd2a
4
Makefile
4
Makefile
|
@ -132,8 +132,8 @@ skimage: $(SKIMAGE_OBJS) out/libskia.a
|
|||
|
||||
##############################################################################
|
||||
|
||||
GM_SRCS := gmmain.cpp xfermodes.cpp gradients.cpp tilemodes.cpp
|
||||
GM_SRCS := $(addprefix gm/, $(GM_SRCS))
|
||||
include gm/gm_files.mk
|
||||
GM_SRCS := $(addprefix gm/, $(SOURCE))
|
||||
|
||||
GM_OBJS := $(GM_SRCS:.cpp=.o)
|
||||
GM_OBJS := $(addprefix out/, $(GM_OBJS))
|
||||
|
|
|
@ -0,0 +1,116 @@
|
|||
#include "gm.h"
|
||||
|
||||
namespace skiagm {
|
||||
|
||||
static void make_bm(SkBitmap* bm) {
|
||||
const SkColor colors[] = {
|
||||
SK_ColorRED, SK_ColorGREEN,
|
||||
SK_ColorBLUE, SK_ColorWHITE
|
||||
};
|
||||
SkColorTable* ctable = new SkColorTable(colors, 4);
|
||||
bm->setConfig(SkBitmap::kIndex8_Config, 2, 2);
|
||||
bm->allocPixels(ctable);
|
||||
ctable->unref();
|
||||
|
||||
*bm->getAddr8(0, 0) = 0;
|
||||
*bm->getAddr8(1, 0) = 1;
|
||||
*bm->getAddr8(0, 1) = 2;
|
||||
*bm->getAddr8(1, 1) = 3;
|
||||
}
|
||||
|
||||
static SkScalar draw_bm(SkCanvas* canvas, const SkBitmap& bm,
|
||||
SkScalar x, SkScalar y, SkPaint* paint) {
|
||||
canvas->drawBitmap(bm, x, y, paint);
|
||||
return SkIntToScalar(bm.width()) * 5/4;
|
||||
}
|
||||
|
||||
static SkScalar draw_set(SkCanvas* c, const SkBitmap& bm, SkScalar x,
|
||||
SkPaint* p) {
|
||||
x += draw_bm(c, bm, x, 0, p);
|
||||
p->setFilterBitmap(true);
|
||||
x += draw_bm(c, bm, x, 0, p);
|
||||
p->setDither(true);
|
||||
return x + draw_bm(c, bm, x, 0, p);
|
||||
}
|
||||
|
||||
static const char* gConfigNames[] = {
|
||||
"unknown config",
|
||||
"A1",
|
||||
"A8",
|
||||
"Index8",
|
||||
"565",
|
||||
"4444",
|
||||
"8888"
|
||||
};
|
||||
|
||||
static SkScalar draw_row(SkCanvas* canvas, const SkBitmap& bm) {
|
||||
SkAutoCanvasRestore acr(canvas, true);
|
||||
|
||||
SkPaint paint;
|
||||
SkScalar x = 0;
|
||||
const int scale = 32;
|
||||
|
||||
paint.setAntiAlias(true);
|
||||
const char* name = gConfigNames[bm.config()];
|
||||
canvas->drawText(name, strlen(name), x, SkIntToScalar(bm.height())*scale*5/8,
|
||||
paint);
|
||||
canvas->translate(SkIntToScalar(48), 0);
|
||||
|
||||
canvas->scale(SkIntToScalar(scale), SkIntToScalar(scale));
|
||||
|
||||
x += draw_set(canvas, bm, 0, &paint);
|
||||
paint.reset();
|
||||
paint.setAlpha(0x80);
|
||||
draw_set(canvas, bm, x, &paint);
|
||||
return x * scale / 3;
|
||||
}
|
||||
|
||||
class FilterGM : public GM {
|
||||
public:
|
||||
SkBitmap fBM8, fBM4444, fBM16, fBM32;
|
||||
|
||||
FilterGM() {
|
||||
make_bm(&fBM8);
|
||||
fBM8.copyTo(&fBM4444, SkBitmap::kARGB_4444_Config);
|
||||
fBM8.copyTo(&fBM16, SkBitmap::kRGB_565_Config);
|
||||
fBM8.copyTo(&fBM32, SkBitmap::kARGB_8888_Config);
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual SkString onShortName() {
|
||||
return SkString("bitmapfilters");
|
||||
}
|
||||
|
||||
virtual SkISize onISize() {
|
||||
return make_isize(540, 330);
|
||||
}
|
||||
|
||||
virtual void onDraw(SkCanvas* canvas) {
|
||||
canvas->drawColor(0xFFDDDDDD);
|
||||
|
||||
SkScalar x = SkIntToScalar(10);
|
||||
SkScalar y = SkIntToScalar(10);
|
||||
|
||||
canvas->translate(x, y);
|
||||
y = draw_row(canvas, fBM8);
|
||||
canvas->translate(0, y);
|
||||
y = draw_row(canvas, fBM4444);
|
||||
canvas->translate(0, y);
|
||||
y = draw_row(canvas, fBM16);
|
||||
canvas->translate(0, y);
|
||||
draw_row(canvas, fBM32);
|
||||
}
|
||||
|
||||
private:
|
||||
typedef GM INHERITED;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static GM* MyFactory(void*) { return new FilterGM; }
|
||||
static GMRegistry reg(MyFactory);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,83 @@
|
|||
#include "gm.h"
|
||||
|
||||
namespace skiagm {
|
||||
|
||||
class FillTypeGM : public GM {
|
||||
SkPath fPath;
|
||||
public:
|
||||
FillTypeGM() {
|
||||
const SkScalar radius = SkIntToScalar(45);
|
||||
fPath.addCircle(SkIntToScalar(50), SkIntToScalar(50), radius);
|
||||
fPath.addCircle(SkIntToScalar(100), SkIntToScalar(100), radius);
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual SkString onShortName() {
|
||||
return SkString("filltypes");
|
||||
}
|
||||
|
||||
virtual SkISize onISize() {
|
||||
return make_isize(835, 840);
|
||||
}
|
||||
|
||||
void showPath(SkCanvas* canvas, int x, int y, SkPath::FillType ft,
|
||||
SkScalar scale, const SkPaint& paint) {
|
||||
|
||||
const SkRect r = { 0, 0, SkIntToScalar(150), SkIntToScalar(150) };
|
||||
|
||||
canvas->save();
|
||||
canvas->translate(SkIntToScalar(x), SkIntToScalar(y));
|
||||
canvas->clipRect(r);
|
||||
canvas->drawColor(SK_ColorWHITE);
|
||||
fPath.setFillType(ft);
|
||||
canvas->translate(r.centerX(), r.centerY());
|
||||
canvas->scale(scale, scale);
|
||||
canvas->translate(-r.centerX(), -r.centerY());
|
||||
canvas->drawPath(fPath, paint);
|
||||
canvas->restore();
|
||||
}
|
||||
|
||||
void showFour(SkCanvas* canvas, SkScalar scale, const SkPaint& paint) {
|
||||
showPath(canvas, 0, 0, SkPath::kWinding_FillType,
|
||||
scale, paint);
|
||||
showPath(canvas, 200, 0, SkPath::kEvenOdd_FillType,
|
||||
scale, paint);
|
||||
showPath(canvas, 00, 200, SkPath::kInverseWinding_FillType,
|
||||
scale, paint);
|
||||
showPath(canvas, 200, 200, SkPath::kInverseEvenOdd_FillType,
|
||||
scale, paint);
|
||||
}
|
||||
|
||||
virtual void onDraw(SkCanvas* canvas) {
|
||||
canvas->drawColor(0xFFDDDDDD);
|
||||
|
||||
canvas->translate(SkIntToScalar(20), SkIntToScalar(20));
|
||||
|
||||
SkPaint paint;
|
||||
const SkScalar scale = SkIntToScalar(5)/4;
|
||||
|
||||
paint.setAntiAlias(false);
|
||||
|
||||
showFour(canvas, SK_Scalar1, paint);
|
||||
canvas->translate(SkIntToScalar(450), 0);
|
||||
showFour(canvas, scale, paint);
|
||||
|
||||
paint.setAntiAlias(true);
|
||||
|
||||
canvas->translate(SkIntToScalar(-450), SkIntToScalar(450));
|
||||
showFour(canvas, SK_Scalar1, paint);
|
||||
canvas->translate(SkIntToScalar(450), 0);
|
||||
showFour(canvas, scale, paint);
|
||||
}
|
||||
|
||||
private:
|
||||
typedef GM INHERITED;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static GM* MyFactory(void*) { return new FillTypeGM; }
|
||||
static GMRegistry reg(MyFactory);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
SOURCE := \
|
||||
bitmapfilters.cpp \
|
||||
filltypes.cpp \
|
||||
gradients.cpp \
|
||||
tilemodes.cpp \
|
||||
xfermodes.cpp \
|
||||
gmmain.cpp
|
|
@ -63,11 +63,13 @@ public:
|
|||
}
|
||||
|
||||
protected:
|
||||
SkString onShortName() {
|
||||
virtual SkString onShortName() {
|
||||
return SkString("xfermodes");
|
||||
}
|
||||
|
||||
SkISize onISize() { return make_isize(790, 480); }
|
||||
virtual SkISize onISize() {
|
||||
return make_isize(790, 480);
|
||||
}
|
||||
|
||||
void drawBG(SkCanvas* canvas) {
|
||||
canvas->drawColor(SK_ColorWHITE);
|
||||
|
|
|
@ -21,9 +21,6 @@
|
|||
#include "SkMath.h"
|
||||
#include "SkXfermode.h"
|
||||
|
||||
// DEPRECATED - remove
|
||||
#include "SkPorterDuff.h"
|
||||
|
||||
class SkAutoGlyphCache;
|
||||
class SkColorFilter;
|
||||
class SkDescriptor;
|
||||
|
@ -465,16 +462,6 @@ public:
|
|||
*/
|
||||
SkXfermode* setXfermode(SkXfermode::Mode);
|
||||
|
||||
/** DEPRECATED
|
||||
Helper for setXfermode, passing the corresponding xfermode object
|
||||
returned from the PorterDuff factory.
|
||||
@param mode The porter-duff mode used to create an xfermode for the
|
||||
paint.
|
||||
@return the resulting xfermode object (or NULL if the mode is
|
||||
SrcOver)
|
||||
*/
|
||||
SkXfermode* setPorterDuffXfermode(SkPorterDuff::Mode mode);
|
||||
|
||||
/** Get the paint's patheffect object.
|
||||
<p />
|
||||
The patheffect reference count is not affected.
|
||||
|
|
|
@ -84,7 +84,7 @@ static void r0(SkLayerRasterizer* rast, SkPaint& p)
|
|||
|
||||
p.setAlpha(0x11);
|
||||
p.setStyle(SkPaint::kFill_Style);
|
||||
p.setPorterDuffXfermode(SkPorterDuff::kSrc_Mode);
|
||||
p.setXfermode(SkXfermode::kSrc_Mode);
|
||||
rast->addLayer(p);
|
||||
}
|
||||
|
||||
|
@ -93,7 +93,7 @@ static void r1(SkLayerRasterizer* rast, SkPaint& p)
|
|||
rast->addLayer(p);
|
||||
|
||||
p.setAlpha(0x40);
|
||||
p.setPorterDuffXfermode(SkPorterDuff::kSrc_Mode);
|
||||
p.setXfermode(SkXfermode::kSrc_Mode);
|
||||
p.setStyle(SkPaint::kStroke_Style);
|
||||
p.setStrokeWidth(SK_Scalar1*2);
|
||||
rast->addLayer(p);
|
||||
|
@ -107,7 +107,7 @@ static void r2(SkLayerRasterizer* rast, SkPaint& p)
|
|||
|
||||
p.setStyle(SkPaint::kStroke_Style);
|
||||
p.setStrokeWidth(SK_Scalar1*3/2);
|
||||
p.setPorterDuffXfermode(SkPorterDuff::kClear_Mode);
|
||||
p.setXfermode(SkXfermode::kClear_Mode);
|
||||
rast->addLayer(p);
|
||||
}
|
||||
|
||||
|
@ -119,7 +119,7 @@ static void r3(SkLayerRasterizer* rast, SkPaint& p)
|
|||
|
||||
p.setAlpha(0x20);
|
||||
p.setStyle(SkPaint::kFill_Style);
|
||||
p.setPorterDuffXfermode(SkPorterDuff::kSrc_Mode);
|
||||
p.setXfermode(SkXfermode::kSrc_Mode);
|
||||
rast->addLayer(p);
|
||||
}
|
||||
|
||||
|
@ -129,7 +129,7 @@ static void r4(SkLayerRasterizer* rast, SkPaint& p)
|
|||
rast->addLayer(p, SkIntToScalar(3), SkIntToScalar(3));
|
||||
|
||||
p.setAlpha(0xFF);
|
||||
p.setPorterDuffXfermode(SkPorterDuff::kClear_Mode);
|
||||
p.setXfermode(SkXfermode::kClear_Mode);
|
||||
rast->addLayer(p, SK_Scalar1*3/2, SK_Scalar1*3/2);
|
||||
|
||||
p.setXfermode(NULL);
|
||||
|
@ -141,7 +141,7 @@ static void r5(SkLayerRasterizer* rast, SkPaint& p)
|
|||
rast->addLayer(p);
|
||||
|
||||
p.setPathEffect(new SkDiscretePathEffect(SK_Scalar1*4, SK_Scalar1*3))->unref();
|
||||
p.setPorterDuffXfermode(SkPorterDuff::kSrcOut_Mode);
|
||||
p.setXfermode(SkXfermode::kSrcOut_Mode);
|
||||
rast->addLayer(p);
|
||||
}
|
||||
|
||||
|
@ -153,7 +153,7 @@ static void r6(SkLayerRasterizer* rast, SkPaint& p)
|
|||
SkLayerRasterizer* rast2 = new SkLayerRasterizer;
|
||||
r5(rast2, p);
|
||||
p.setRasterizer(rast2)->unref();
|
||||
p.setPorterDuffXfermode(SkPorterDuff::kClear_Mode);
|
||||
p.setXfermode(SkXfermode::kClear_Mode);
|
||||
rast->addLayer(p);
|
||||
}
|
||||
|
||||
|
@ -208,7 +208,7 @@ static void r8(SkLayerRasterizer* rast, SkPaint& p)
|
|||
lattice.setScale(SK_Scalar1*6, SK_Scalar1*6, 0, 0);
|
||||
lattice.postSkew(SK_Scalar1/3, 0, 0, 0);
|
||||
p.setPathEffect(new Dot2DPathEffect(SK_Scalar1*2, lattice))->unref();
|
||||
p.setPorterDuffXfermode(SkPorterDuff::kClear_Mode);
|
||||
p.setXfermode(SkXfermode::kClear_Mode);
|
||||
rast->addLayer(p);
|
||||
|
||||
p.setPathEffect(NULL);
|
||||
|
@ -278,7 +278,7 @@ static void r9(SkLayerRasterizer* rast, SkPaint& p)
|
|||
lattice.setScale(SK_Scalar1, SK_Scalar1*6, 0, 0);
|
||||
lattice.postRotate(SkIntToScalar(30), 0, 0);
|
||||
p.setPathEffect(new Line2DPathEffect(SK_Scalar1*2, lattice))->unref();
|
||||
p.setPorterDuffXfermode(SkPorterDuff::kClear_Mode);
|
||||
p.setXfermode(SkXfermode::kClear_Mode);
|
||||
rast->addLayer(p);
|
||||
|
||||
p.setPathEffect(NULL);
|
||||
|
@ -489,7 +489,7 @@ protected:
|
|||
SkEmbossMaskFilter* embossFilter = new SkEmbossMaskFilter(light,
|
||||
radius);
|
||||
|
||||
SkXfermode* xfermode = SkPorterDuff::CreateXfermode(SkPorterDuff::kXor_Mode);
|
||||
SkXfermode* xfermode = SkXfermode::Create(SkXfermode::kXor_Mode);
|
||||
SkColorFilter* lightingFilter = SkColorFilter::CreateLightingFilter(
|
||||
0xff89bc45, 0xff112233);
|
||||
|
||||
|
@ -684,7 +684,7 @@ SkCornerPathEffect.h:28:class SkCornerPathEffect : public SkPathEffect {
|
|||
SkColor colors2[] = {SK_ColorBLACK, SkColorSetARGB(0x80, 0, 0, 0)};
|
||||
SkShader* shaderB = SkGradientShader::CreateLinear(pts, colors2, NULL,
|
||||
2, SkShader::kClamp_TileMode);
|
||||
SkXfermode* mode = SkPorterDuff::CreateXfermode(SkPorterDuff::kDstIn_Mode);
|
||||
SkXfermode* mode = SkXfermode::Create(SkXfermode::kDstIn_Mode);
|
||||
SkShader* result = new SkComposeShader(shaderA, shaderB, mode);
|
||||
shaderA->unref();
|
||||
shaderB->unref();
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
#include "SkRandom.h"
|
||||
#include "SkColorPriv.h"
|
||||
#include "SkColorFilter.h"
|
||||
#include "SkPorterDuff.h"
|
||||
#include "SkLayerRasterizer.h"
|
||||
|
||||
#include "SkParsePath.h"
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
#include "SkGraphics.h"
|
||||
#include "SkImageDecoder.h"
|
||||
#include "SkPath.h"
|
||||
#include "SkPorterDuff.h"
|
||||
#include "SkRegion.h"
|
||||
#include "SkShader.h"
|
||||
#include "SkUtils.h"
|
||||
|
|
|
@ -36,7 +36,6 @@ protected:
|
|||
void drawBG(SkCanvas* canvas)
|
||||
{
|
||||
canvas->drawColor(0xFFDDDDDD);
|
||||
// canvas->drawColor(0, SkPorterDuff::kClear_Mode);
|
||||
}
|
||||
|
||||
virtual void onDraw(SkCanvas* canvas)
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#include "SampleCode.h"
|
||||
#include "SkCanvas.h"
|
||||
#include "SkPaint.h"
|
||||
#include "SkPorterDuff.h"
|
||||
#include "SkView.h"
|
||||
|
||||
#include "SkBlurMaskFilter.h"
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
#include "SkImageDecoder.h"
|
||||
#include "SkImageEncoder.h"
|
||||
#include "SkPath.h"
|
||||
#include "SkPorterDuff.h"
|
||||
#include "SkRegion.h"
|
||||
#include "SkShader.h"
|
||||
#include "SkUtils.h"
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
#include "SkGraphics.h"
|
||||
#include "SkImageDecoder.h"
|
||||
#include "SkPath.h"
|
||||
#include "SkPorterDuff.h"
|
||||
#include "SkRegion.h"
|
||||
#include "SkShader.h"
|
||||
#include "SkUtils.h"
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
#include "SkBlurMaskFilter.h"
|
||||
#include "SkPaint.h"
|
||||
#include "SkPath.h"
|
||||
#include "SkPorterDuff.h"
|
||||
#include "SkXfermode.h"
|
||||
#include "SkMatrix.h"
|
||||
#include "SkColor.h"
|
||||
|
@ -117,13 +116,13 @@ static void do_fuzz(SkCanvas* canvas) {
|
|||
break;
|
||||
|
||||
case 2: {
|
||||
SkPorterDuff::Mode mode;
|
||||
switch (R(3)) {
|
||||
case 0: mode = SkPorterDuff::kSrc_Mode; break;
|
||||
case 1: mode = SkPorterDuff::kXor_Mode; break;
|
||||
case 2: mode = SkPorterDuff::kSrcOver_Mode; break;
|
||||
}
|
||||
paint.setXfermode(SkPorterDuff::CreateXfermode(mode))->safeUnref();
|
||||
SkXfermode::Mode mode;
|
||||
switch (R(3)) {
|
||||
case 0: mode = SkXfermode::kSrc_Mode; break;
|
||||
case 1: mode = SkXfermode::kXor_Mode; break;
|
||||
case 2: mode = SkXfermode::kSrcOver_Mode; break;
|
||||
}
|
||||
paint.setXfermode(mode);
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
#include "SkGraphics.h"
|
||||
#include "SkImageDecoder.h"
|
||||
#include "SkPath.h"
|
||||
#include "SkPorterDuff.h"
|
||||
#include "SkRegion.h"
|
||||
#include "SkShader.h"
|
||||
#include "SkUtils.h"
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
#include "SkGraphics.h"
|
||||
#include "SkImageDecoder.h"
|
||||
#include "SkPath.h"
|
||||
#include "SkPorterDuff.h"
|
||||
#include "SkRegion.h"
|
||||
#include "SkShader.h"
|
||||
#include "SkUtils.h"
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#include "SampleCode.h"
|
||||
#include "SkCanvas.h"
|
||||
#include "SkPaint.h"
|
||||
#include "SkPorterDuff.h"
|
||||
#include "SkView.h"
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -36,13 +35,13 @@ protected:
|
|||
bounds.offset(-bounds.fLeft, -bounds.fTop);
|
||||
c.drawOval(bounds, paint);
|
||||
|
||||
paint.setPorterDuffXfermode(SkPorterDuff::kDstIn_Mode);
|
||||
paint.setXfermode(SkXfermode::kDstIn_Mode);
|
||||
canvas->drawBitmap(mask, r.fLeft, r.fTop, &paint);
|
||||
} else {
|
||||
SkPath p;
|
||||
p.addOval(r);
|
||||
p.setFillType(SkPath::kInverseWinding_FillType);
|
||||
paint.setPorterDuffXfermode(SkPorterDuff::kDstOut_Mode);
|
||||
paint.setXfermode(SkXfermode::kDstOut_Mode);
|
||||
canvas->drawPath(p, paint);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
#include "SkTypeface.h"
|
||||
#include "SkUtils.h"
|
||||
#include "SkKey.h"
|
||||
#include "SkPorterDuff.h"
|
||||
#include "SkXfermode.h"
|
||||
#include "SkDrawFilter.h"
|
||||
|
||||
|
@ -27,7 +26,7 @@ static void make_paint(SkPaint* paint) {
|
|||
SkShader* s = SkGradientShader::CreateLinear(pts, colors, NULL, 2, SkShader::kClamp_TileMode);
|
||||
|
||||
paint->setShader(s)->unref();
|
||||
paint->setXfermode(SkPorterDuff::CreateXfermode(SkPorterDuff::kDstIn_Mode))->unref();
|
||||
paint->setXfermode(SkXfermode::kDstIn_Mode);
|
||||
}
|
||||
|
||||
static void dump_layers(const char label[], SkCanvas* canvas) {
|
||||
|
@ -163,7 +162,7 @@ protected:
|
|||
canvas->saveLayer(&r, &p);
|
||||
canvas->drawColor(0xFFFF0000);
|
||||
p.setAlpha(1); // or 0
|
||||
p.setPorterDuffXfermode(SkPorterDuff::kSrc_Mode);
|
||||
p.setXfermode(SkXfermode::kSrc_Mode);
|
||||
canvas->drawOval(r, p);
|
||||
canvas->restore();
|
||||
return;
|
||||
|
@ -240,7 +239,7 @@ protected:
|
|||
canvas->drawOval(r, p);
|
||||
|
||||
p.setAlpha(0x80);
|
||||
p.setPorterDuffXfermode(SkPorterDuff::kDstIn_Mode);
|
||||
p.setXfermode(SkXfermode::kDstIn_Mode);
|
||||
canvas->drawRect(bounds, p);
|
||||
|
||||
canvas->restore();
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
#include "SkGraphics.h"
|
||||
#include "SkImageDecoder.h"
|
||||
#include "SkPath.h"
|
||||
#include "SkPorterDuff.h"
|
||||
#include "SkRandom.h"
|
||||
#include "SkRegion.h"
|
||||
#include "SkShader.h"
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
#include "SkGraphics.h"
|
||||
#include "SkImageDecoder.h"
|
||||
#include "SkPath.h"
|
||||
#include "SkPorterDuff.h"
|
||||
#include "SkRegion.h"
|
||||
#include "SkShader.h"
|
||||
#include "SkUtils.h"
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
#include "SkGraphics.h"
|
||||
#include "SkImageDecoder.h"
|
||||
#include "SkPath.h"
|
||||
#include "SkPorterDuff.h"
|
||||
#include "SkRegion.h"
|
||||
#include "SkShader.h"
|
||||
#include "SkUtils.h"
|
||||
|
|
|
@ -75,7 +75,6 @@ static SkPathEffect* make_warp_pe()
|
|||
///////////////////////////////////////////////////////////
|
||||
|
||||
#include "SkColorFilter.h"
|
||||
#include "SkPorterDuff.h"
|
||||
#include "SkLayerRasterizer.h"
|
||||
|
||||
class testrast : public SkLayerRasterizer {
|
||||
|
@ -91,7 +90,7 @@ public:
|
|||
this->addLayer(paint);
|
||||
|
||||
paint.setStrokeWidth(SK_Scalar1*1);
|
||||
paint.setPorterDuffXfermode(SkPorterDuff::kClear_Mode);
|
||||
paint.setXfermode(SkXfermode::kClear_Mode);
|
||||
this->addLayer(paint);
|
||||
#else
|
||||
paint.setAlpha(0x66);
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
#include "SkGraphics.h"
|
||||
#include "SkImageDecoder.h"
|
||||
#include "SkPath.h"
|
||||
#include "SkPorterDuff.h"
|
||||
#include "SkRegion.h"
|
||||
#include "SkShader.h"
|
||||
#include "SkUtils.h"
|
||||
|
@ -31,7 +30,7 @@ static SkShader* make_bitmapfade(const SkBitmap& bm)
|
|||
SkShader* shaderB = SkShader::CreateBitmapShader(bm,
|
||||
SkShader::kClamp_TileMode, SkShader::kClamp_TileMode);
|
||||
|
||||
SkXfermode* mode = SkPorterDuff::CreateXfermode(SkPorterDuff::kDstIn_Mode);
|
||||
SkXfermode* mode = SkXfermode::Create(SkXfermode::kDstIn_Mode);
|
||||
|
||||
SkShader* shader = new SkComposeShader(shaderB, shaderA, mode);
|
||||
shaderA->unref();
|
||||
|
@ -65,7 +64,7 @@ public:
|
|||
colors[1] = SkColorSetARGB(0x80, 0, 0, 0);
|
||||
SkShader* shaderB = SkGradientShader::CreateLinear(pts, colors, NULL, 2, SkShader::kClamp_TileMode);
|
||||
|
||||
SkXfermode* mode = SkPorterDuff::CreateXfermode(SkPorterDuff::kDstIn_Mode);
|
||||
SkXfermode* mode = SkXfermode::Create(SkXfermode::kDstIn_Mode);
|
||||
|
||||
fShader = new SkComposeShader(shaderA, shaderB, mode);
|
||||
shaderA->unref();
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#include "SampleCode.h"
|
||||
#include "SkCanvas.h"
|
||||
#include "SkPaint.h"
|
||||
#include "SkPorterDuff.h"
|
||||
#include "SkView.h"
|
||||
|
||||
#include "SkRectShape.h"
|
||||
|
|
|
@ -55,7 +55,7 @@ static void lettersToBitmap(SkBitmap* dst, const char chars[],
|
|||
dst->eraseColor(SK_ColorWHITE);
|
||||
{
|
||||
SkCanvas canvas(*dst);
|
||||
paint.setPorterDuffXfermode(SkPorterDuff::kDstATop_Mode);
|
||||
paint.setXfermode(SkXfermode::kDstATop_Mode);
|
||||
canvas.drawBitmap(src, 0, 0, &paint);
|
||||
paint.setColor(original.getColor());
|
||||
paint.setStyle(SkPaint::kStroke_Style);
|
||||
|
@ -86,7 +86,7 @@ static void lettersToBitmap2(SkBitmap* dst, const char chars[],
|
|||
SkPaint paint(original);
|
||||
|
||||
paint.setAntiAlias(true);
|
||||
paint.setPorterDuffXfermode(SkPorterDuff::kDstATop_Mode);
|
||||
paint.setXfermode(SkXfermode::kDstATop_Mode);
|
||||
paint.setColor(original.getColor());
|
||||
paint.setStyle(SkPaint::kStroke_Style);
|
||||
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
#include "SkTypeface.h"
|
||||
#include "SkUtils.h"
|
||||
#include "SkKey.h"
|
||||
#include "SkPorterDuff.h"
|
||||
#include "SkXfermode.h"
|
||||
#include "SkDrawFilter.h"
|
||||
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
#include "SkGraphics.h"
|
||||
#include "SkImageDecoder.h"
|
||||
#include "SkPath.h"
|
||||
#include "SkPorterDuff.h"
|
||||
#include "SkRandom.h"
|
||||
#include "SkRegion.h"
|
||||
#include "SkShader.h"
|
||||
|
|
|
@ -68,7 +68,7 @@ static void r0(SkLayerRasterizer* rast, SkPaint& p)
|
|||
|
||||
p.setAlpha(0x11);
|
||||
p.setStyle(SkPaint::kFill_Style);
|
||||
p.setPorterDuffXfermode(SkPorterDuff::kSrc_Mode);
|
||||
p.setXfermode(SkXfermode::kSrc_Mode);
|
||||
rast->addLayer(p);
|
||||
}
|
||||
|
||||
|
@ -77,7 +77,7 @@ static void r1(SkLayerRasterizer* rast, SkPaint& p)
|
|||
rast->addLayer(p);
|
||||
|
||||
p.setAlpha(0x40);
|
||||
p.setPorterDuffXfermode(SkPorterDuff::kSrc_Mode);
|
||||
p.setXfermode(SkXfermode::kSrc_Mode);
|
||||
p.setStyle(SkPaint::kStroke_Style);
|
||||
p.setStrokeWidth(SK_Scalar1*2);
|
||||
rast->addLayer(p);
|
||||
|
@ -91,7 +91,7 @@ static void r2(SkLayerRasterizer* rast, SkPaint& p)
|
|||
|
||||
p.setStyle(SkPaint::kStroke_Style);
|
||||
p.setStrokeWidth(SK_Scalar1*3/2);
|
||||
p.setPorterDuffXfermode(SkPorterDuff::kClear_Mode);
|
||||
p.setXfermode(SkXfermode::kClear_Mode);
|
||||
rast->addLayer(p);
|
||||
}
|
||||
|
||||
|
@ -103,7 +103,7 @@ static void r3(SkLayerRasterizer* rast, SkPaint& p)
|
|||
|
||||
p.setAlpha(0x20);
|
||||
p.setStyle(SkPaint::kFill_Style);
|
||||
p.setPorterDuffXfermode(SkPorterDuff::kSrc_Mode);
|
||||
p.setXfermode(SkXfermode::kSrc_Mode);
|
||||
rast->addLayer(p);
|
||||
}
|
||||
|
||||
|
@ -113,7 +113,7 @@ static void r4(SkLayerRasterizer* rast, SkPaint& p)
|
|||
rast->addLayer(p, SkIntToScalar(3), SkIntToScalar(3));
|
||||
|
||||
p.setAlpha(0xFF);
|
||||
p.setPorterDuffXfermode(SkPorterDuff::kClear_Mode);
|
||||
p.setXfermode(SkXfermode::kClear_Mode);
|
||||
rast->addLayer(p, SK_Scalar1*3/2, SK_Scalar1*3/2);
|
||||
|
||||
p.setXfermode(NULL);
|
||||
|
@ -127,7 +127,7 @@ static void r5(SkLayerRasterizer* rast, SkPaint& p)
|
|||
rast->addLayer(p);
|
||||
|
||||
p.setPathEffect(new SkDiscretePathEffect(SK_Scalar1*4, SK_Scalar1*3))->unref();
|
||||
p.setPorterDuffXfermode(SkPorterDuff::kSrcOut_Mode);
|
||||
p.setXfermode(SkXfermode::kSrcOut_Mode);
|
||||
rast->addLayer(p);
|
||||
}
|
||||
|
||||
|
@ -139,7 +139,7 @@ static void r6(SkLayerRasterizer* rast, SkPaint& p)
|
|||
SkLayerRasterizer* rast2 = new SkLayerRasterizer;
|
||||
r5(rast2, p);
|
||||
p.setRasterizer(rast2)->unref();
|
||||
p.setPorterDuffXfermode(SkPorterDuff::kClear_Mode);
|
||||
p.setXfermode(SkXfermode::kClear_Mode);
|
||||
rast->addLayer(p);
|
||||
}
|
||||
|
||||
|
@ -196,7 +196,7 @@ static void r8(SkLayerRasterizer* rast, SkPaint& p)
|
|||
lattice.setScale(SK_Scalar1*6, SK_Scalar1*6, 0, 0);
|
||||
lattice.postSkew(SK_Scalar1/3, 0, 0, 0);
|
||||
p.setPathEffect(new Dot2DPathEffect(SK_Scalar1*2, lattice))->unref();
|
||||
p.setPorterDuffXfermode(SkPorterDuff::kClear_Mode);
|
||||
p.setXfermode(SkXfermode::kClear_Mode);
|
||||
rast->addLayer(p);
|
||||
|
||||
p.setPathEffect(NULL);
|
||||
|
@ -269,7 +269,7 @@ static void r9(SkLayerRasterizer* rast, SkPaint& p)
|
|||
lattice.setScale(SK_Scalar1, SK_Scalar1*6, 0, 0);
|
||||
lattice.postRotate(SkIntToScalar(30), 0, 0);
|
||||
p.setPathEffect(new Line2DPathEffect(SK_Scalar1*2, lattice))->unref();
|
||||
p.setPorterDuffXfermode(SkPorterDuff::kClear_Mode);
|
||||
p.setXfermode(SkXfermode::kClear_Mode);
|
||||
rast->addLayer(p);
|
||||
|
||||
p.setPathEffect(NULL);
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
#include "SkGraphics.h"
|
||||
#include "SkImageDecoder.h"
|
||||
#include "SkPath.h"
|
||||
#include "SkPorterDuff.h"
|
||||
#include "SkRandom.h"
|
||||
#include "SkRegion.h"
|
||||
#include "SkShader.h"
|
||||
|
|
|
@ -74,9 +74,3 @@ SkXfermodeProc16 SkPorterDuff::GetXfermodeProc16(Mode mode, SkColor srcColor) {
|
|||
return SkXfermode::GetProc16(gPairs[mode].fXF, srcColor);
|
||||
}
|
||||
|
||||
// DEPRECATED
|
||||
#include "SkPaint.h"
|
||||
SkXfermode* SkPaint::setPorterDuffXfermode(SkPorterDuff::Mode mode) {
|
||||
return this->setXfermode(SkPorterDuff::CreateXfermode(mode));
|
||||
}
|
||||
|
||||
|
|
|
@ -39,9 +39,6 @@
|
|||
0041CE3A0F00A12400695E8C /* SampleDrawLooper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0041CE240F00A12400695E8C /* SampleDrawLooper.cpp */; };
|
||||
0041CE3B0F00A12400695E8C /* SampleEmboss.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0041CE250F00A12400695E8C /* SampleEmboss.cpp */; };
|
||||
0041CE3C0F00A12400695E8C /* SampleEncode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0041CE260F00A12400695E8C /* SampleEncode.cpp */; };
|
||||
0041CE3D0F00A12400695E8C /* SampleFillType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0041CE270F00A12400695E8C /* SampleFillType.cpp */; };
|
||||
0041CE3E0F00A12400695E8C /* SampleFilter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0041CE280F00A12400695E8C /* SampleFilter.cpp */; };
|
||||
0041CE3F0F00A12400695E8C /* SampleFilter2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0041CE290F00A12400695E8C /* SampleFilter2.cpp */; };
|
||||
0041CE400F00A12400695E8C /* SampleFontCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0041CE2A0F00A12400695E8C /* SampleFontCache.cpp */; };
|
||||
0041CE420F00A12400695E8C /* SampleImage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0041CE2C0F00A12400695E8C /* SampleImage.cpp */; };
|
||||
0041CE430F00A12400695E8C /* SampleLayers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0041CE2D0F00A12400695E8C /* SampleLayers.cpp */; };
|
||||
|
@ -50,6 +47,9 @@
|
|||
0041CE470F00A12400695E8C /* SampleNinePatch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0041CE310F00A12400695E8C /* SampleNinePatch.cpp */; };
|
||||
0041CE480F00A12400695E8C /* SampleOverflow.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0041CE320F00A12400695E8C /* SampleOverflow.cpp */; };
|
||||
0041CE4A0F00A12400695E8C /* SamplePatch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0041CE340F00A12400695E8C /* SamplePatch.cpp */; };
|
||||
005E92DC0FF08507008965B9 /* SampleFilter2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0041CE290F00A12400695E8C /* SampleFilter2.cpp */; };
|
||||
005E92DE0FF0850E008965B9 /* SampleFillType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0041CE270F00A12400695E8C /* SampleFillType.cpp */; };
|
||||
005E92E00FF08512008965B9 /* SampleFilter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0041CE280F00A12400695E8C /* SampleFilter.cpp */; };
|
||||
007A7CB30F01658C00A2D6EE /* SamplePicture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 007A7CA40F01658C00A2D6EE /* SamplePicture.cpp */; };
|
||||
007A7CB40F01658C00A2D6EE /* SamplePoints.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 007A7CA50F01658C00A2D6EE /* SamplePoints.cpp */; };
|
||||
007A7CB60F01658C00A2D6EE /* SampleRegion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 007A7CA70F01658C00A2D6EE /* SampleRegion.cpp */; };
|
||||
|
@ -533,9 +533,6 @@
|
|||
0041CE390F00A12400695E8C /* SampleDither.cpp in Sources */,
|
||||
0041CE3A0F00A12400695E8C /* SampleDrawLooper.cpp in Sources */,
|
||||
0041CE3B0F00A12400695E8C /* SampleEmboss.cpp in Sources */,
|
||||
0041CE3D0F00A12400695E8C /* SampleFillType.cpp in Sources */,
|
||||
0041CE3E0F00A12400695E8C /* SampleFilter.cpp in Sources */,
|
||||
0041CE3F0F00A12400695E8C /* SampleFilter2.cpp in Sources */,
|
||||
0041CE400F00A12400695E8C /* SampleFontCache.cpp in Sources */,
|
||||
0041CE420F00A12400695E8C /* SampleImage.cpp in Sources */,
|
||||
0041CE430F00A12400695E8C /* SampleLayers.cpp in Sources */,
|
||||
|
@ -575,6 +572,9 @@
|
|||
2794C04F0FE72903009AD112 /* SampleMipMap.cpp in Sources */,
|
||||
00AF787E0FE94433007F9650 /* SamplePath.cpp in Sources */,
|
||||
0088C1160FEC311C00CE52F5 /* SampleXfermodes.cpp in Sources */,
|
||||
005E92DC0FF08507008965B9 /* SampleFilter2.cpp in Sources */,
|
||||
005E92DE0FF0850E008965B9 /* SampleFillType.cpp in Sources */,
|
||||
005E92E00FF08512008965B9 /* SampleFilter.cpp in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче