use drawBitmapNine instead of SkNinePatch utils
git-svn-id: http://skia.googlecode.com/svn/trunk@2237 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
55b5f4bd6a
commit
9c9b8d90c8
@ -8,7 +8,6 @@
|
||||
#include "gm.h"
|
||||
|
||||
#include "SkGpuDevice.h"
|
||||
#include "SkNinePatch.h"
|
||||
|
||||
static void make_bitmap(SkBitmap* bitmap, GrContext* ctx, SkIRect* center) {
|
||||
SkDevice* dev;
|
||||
@ -66,14 +65,6 @@ protected:
|
||||
return make_isize(400, 400);
|
||||
}
|
||||
|
||||
static void drawNine(SkCanvas* canvas, const SkRect& dst, const SkBitmap& bm,
|
||||
const SkIRect& center, const SkPaint* paint) {
|
||||
SkIRect margin;
|
||||
margin.set(center.fLeft, center.fTop, bm.width() - center.fRight,
|
||||
bm.height() - center.fBottom);
|
||||
SkNinePatch::DrawNine(canvas, dst, bm, margin, paint);
|
||||
}
|
||||
|
||||
virtual void onDraw(SkCanvas* canvas) {
|
||||
canvas->drawColor(SK_ColorWHITE);
|
||||
|
||||
@ -104,7 +95,7 @@ protected:
|
||||
int i = ix * 2 + iy;
|
||||
SkRect r = SkRect::MakeXYWH(x + ix * fixed, y + iy * fixed,
|
||||
size[i].width(), size[i].height());
|
||||
drawNine(canvas, r, bm, center, &paint);
|
||||
canvas->drawBitmapNine(bm, center, r, &paint);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,6 @@
|
||||
*/
|
||||
#include "SampleCode.h"
|
||||
#include "SkCanvas.h"
|
||||
#include "SkNinePatch.h"
|
||||
#include "SkPaint.h"
|
||||
#include "SkGpuDevice.h"
|
||||
|
||||
@ -65,14 +64,6 @@ protected:
|
||||
return this->INHERITED::onQuery(evt);
|
||||
}
|
||||
|
||||
static void drawNine(SkCanvas* canvas, const SkRect& dst, const SkBitmap& bm,
|
||||
const SkIRect& center, const SkPaint* paint) {
|
||||
SkIRect margin;
|
||||
margin.set(center.fLeft, center.fTop, bm.width() - center.fRight,
|
||||
bm.height() - center.fBottom);
|
||||
SkNinePatch::DrawNine(canvas, dst, bm, margin, paint);
|
||||
}
|
||||
|
||||
virtual void onDrawContent(SkCanvas* canvas) {
|
||||
SkBitmap bm;
|
||||
SkIRect center;
|
||||
@ -101,7 +92,7 @@ protected:
|
||||
int i = ix * 2 + iy;
|
||||
SkRect r = SkRect::MakeXYWH(x + ix * fixed, y + iy * fixed,
|
||||
size[i].width(), size[i].height());
|
||||
drawNine(canvas, r, bm, center, &paint);
|
||||
canvas->drawBitmapNine(bm, center, r, &paint);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -314,7 +314,6 @@ static void textonpath_slide(SkCanvas* canvas) {
|
||||
#include "SkOSFile.h"
|
||||
#include "SkRandom.h"
|
||||
#include "SkStream.h"
|
||||
#include "SkNinePatch.h"
|
||||
|
||||
static SkShader* make_shader0(SkIPoint* size) {
|
||||
SkBitmap bm;
|
||||
|
@ -24,7 +24,6 @@
|
||||
|
||||
#include "SkOSFile.h"
|
||||
#include "SkStream.h"
|
||||
#include "SkNinePatch.h"
|
||||
|
||||
static SkShader* make_shader0(SkIPoint* size) {
|
||||
SkBitmap bm;
|
||||
|
Loading…
Reference in New Issue
Block a user