зеркало из https://github.com/mozilla/moz-skia.git
check bounder before lockPixels on the bitmap
git-svn-id: http://skia.googlecode.com/svn/trunk@493 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
Родитель
985dfad8ec
Коммит
218521e157
|
@ -1042,12 +1042,21 @@ void SkDraw::drawBitmap(const SkBitmap& bitmap, const SkMatrix& prematrix,
|
|||
return;
|
||||
}
|
||||
|
||||
// do I need to call the bounder first???
|
||||
if (clipped_out(matrix, *fClip, bitmap.width(), bitmap.height())) {
|
||||
return;
|
||||
}
|
||||
|
||||
// only lock the pixels if we passed the clip test
|
||||
if (fBounder && just_translate(matrix, bitmap)) {
|
||||
SkIRect ir;
|
||||
int32_t ix = SkScalarRound(matrix.getTranslateX());
|
||||
int32_t iy = SkScalarRound(matrix.getTranslateY());
|
||||
ir.set(ix, iy, ix + bitmap.width(), iy + bitmap.height());
|
||||
if (!fBounder->doIRect(ir)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// only lock the pixels if we passed the clip and bounder tests
|
||||
SkAutoLockPixels alp(bitmap);
|
||||
// after the lock, check if we are valid
|
||||
if (!bitmap.readyToDraw()) {
|
||||
|
@ -1067,10 +1076,6 @@ void SkDraw::drawBitmap(const SkBitmap& bitmap, const SkMatrix& prematrix,
|
|||
SkIRect ir;
|
||||
ir.set(ix, iy, ix + bitmap.width(), iy + bitmap.height());
|
||||
|
||||
if (fBounder && !fBounder->doIRect(ir)) {
|
||||
return;
|
||||
}
|
||||
|
||||
SkRegion::Cliperator iter(*fClip, ir);
|
||||
const SkIRect& cr = iter.rect();
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче