From 397e2e1d65492b9d01d91f7f6cbc2890e335a373 Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Thu, 17 Dec 2015 14:45:45 -0500 Subject: [PATCH] Bug 1082598 - Part 5: Fix NPAPI for Skia update. r=jrmuizel --- other-licenses/skia-npapi/ANPCanvas.cpp | 13 +++++++++---- other-licenses/skia-npapi/ANPTypeface.cpp | 1 + 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/other-licenses/skia-npapi/ANPCanvas.cpp b/other-licenses/skia-npapi/ANPCanvas.cpp index 0b842c55826..dd227eca8df 100644 --- a/other-licenses/skia-npapi/ANPCanvas.cpp +++ b/other-licenses/skia-npapi/ANPCanvas.cpp @@ -153,13 +153,18 @@ static void anp_drawBitmapRect(ANPCanvas* canvas, const ANPBitmap* bitmap, const ANPPaint* paint) { SkBitmap bm; SkRect dstR; - SkIRect srcR, *srcPtr = NULL; + SkIRect srcR; 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); } /////////////////////////////////////////////////////////////////////////////// diff --git a/other-licenses/skia-npapi/ANPTypeface.cpp b/other-licenses/skia-npapi/ANPTypeface.cpp index 26251bc994f..ccbaf41c66c 100644 --- a/other-licenses/skia-npapi/ANPTypeface.cpp +++ b/other-licenses/skia-npapi/ANPTypeface.cpp @@ -27,6 +27,7 @@ #include "SkANP.h" #include "SkFontHost.h" #include "SkStream.h" +#include static ANPTypeface* anp_createFromName(const char name[], ANPTypefaceStyle s) { SkTypeface* tf = SkTypeface::CreateFromName(name,