reimage ninepatch-stretch with white bg (for easier printing)
git-svn-id: http://skia.googlecode.com/svn/trunk@2225 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
b67052596f
commit
b636adf980
@ -75,7 +75,7 @@ protected:
|
||||
}
|
||||
|
||||
virtual void onDraw(SkCanvas* canvas) {
|
||||
canvas->drawColor(SK_ColorBLACK);
|
||||
canvas->drawColor(SK_ColorWHITE);
|
||||
|
||||
SkBitmap bm;
|
||||
SkIRect center;
|
||||
|
@ -66,7 +66,7 @@ protected:
|
||||
}
|
||||
|
||||
virtual void onDrawContent(SkCanvas* canvas) {
|
||||
GrContext* ctx = NULL;//SampleCode::GetGr();
|
||||
GrContext* ctx = SampleCode::GetGr();
|
||||
|
||||
const SkIRect src[] = {
|
||||
{ 0, 0, 32, 32 },
|
||||
|
@ -6,12 +6,9 @@
|
||||
* found in the LICENSE file.
|
||||
*/
|
||||
#include "SampleCode.h"
|
||||
#include "SkView.h"
|
||||
#include "SkCanvas.h"
|
||||
#include "SkImageDecoder.h"
|
||||
#include "SkNinePatch.h"
|
||||
#include "SkPaint.h"
|
||||
#include "SkUnPreMultiply.h"
|
||||
#include "SkGpuDevice.h"
|
||||
|
||||
static void make_bitmap(SkBitmap* bitmap, GrContext* ctx, SkIRect* center) {
|
||||
@ -43,16 +40,6 @@ static void make_bitmap(SkBitmap* bitmap, GrContext* ctx, SkIRect* center) {
|
||||
SkPaint paint;
|
||||
paint.setAntiAlias(true);
|
||||
|
||||
#if 0
|
||||
r.inset(strokeWidth/2, strokeWidth/2);
|
||||
|
||||
paint.setColor(SK_ColorBLUE);
|
||||
canvas.drawRoundRect(r, radius, radius, paint);
|
||||
paint.setColor(SK_ColorRED);
|
||||
paint.setStyle(SkPaint::kStroke_Style);
|
||||
paint.setStrokeWidth(strokeWidth);
|
||||
canvas.drawRoundRect(r, radius, radius, paint);
|
||||
#else
|
||||
paint.setColor(0xFFFF0000);
|
||||
canvas.drawRoundRect(r, radius, radius, paint);
|
||||
r.setXYWH(SkIntToScalar(kFixed), 0, SkIntToScalar(kStretchy), SkIntToScalar(kSize));
|
||||
@ -61,7 +48,6 @@ static void make_bitmap(SkBitmap* bitmap, GrContext* ctx, SkIRect* center) {
|
||||
r.setXYWH(0, SkIntToScalar(kFixed), SkIntToScalar(kSize), SkIntToScalar(kStretchy));
|
||||
paint.setColor(0x880000FF);
|
||||
canvas.drawRect(r, paint);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user