Bug 1082598 - Part 5: Fix NPAPI for Skia update. r=jrmuizel

This commit is contained in:
Lee Salzman 2015-12-17 14:45:45 -05:00
parent 7ba4aae815
commit 397e2e1d65
2 changed files with 10 additions and 4 deletions

View File

@ -153,13 +153,18 @@ static void anp_drawBitmapRect(ANPCanvas* canvas, const ANPBitmap* bitmap,
const ANPPaint* paint) { const ANPPaint* paint) {
SkBitmap bm; SkBitmap bm;
SkRect dstR; SkRect dstR;
SkIRect srcR, *srcPtr = NULL; SkIRect srcR;
if (src) { if (src) {
srcPtr = SkANP::SetRect(&srcR, *src); canvas->skcanvas->drawBitmapRect(*SkANP::SetBitmap(&bm, *bitmap),
*SkANP::SetRect(&srcR, *src),
*SkANP::SetRect(&dstR, *dst),
paint);
} else {
canvas->skcanvas->drawBitmapRect(*SkANP::SetBitmap(&bm, *bitmap),
*SkANP::SetRect(&dstR, *dst),
paint);
} }
canvas->skcanvas->drawBitmapRect(*SkANP::SetBitmap(&bm, *bitmap), srcPtr,
*SkANP::SetRect(&dstR, *dst), paint);
} }
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////

View File

@ -27,6 +27,7 @@
#include "SkANP.h" #include "SkANP.h"
#include "SkFontHost.h" #include "SkFontHost.h"
#include "SkStream.h" #include "SkStream.h"
#include <stdlib.h>
static ANPTypeface* anp_createFromName(const char name[], ANPTypefaceStyle s) { static ANPTypeface* anp_createFromName(const char name[], ANPTypefaceStyle s) {
SkTypeface* tf = SkTypeface::CreateFromName(name, SkTypeface* tf = SkTypeface::CreateFromName(name,