Bug 1313135 - Make an early return if the clip rect can be ignored. r=mchang

--HG--
extra : rebase_source : 3e1b5c15398a2536528c5b8799d2272ee4d07c66
This commit is contained in:
Kevin Chen 2016-11-21 18:55:00 -05:00
Родитель 9eee2514e9
Коммит ed05291591
2 изменённых файлов: 5 добавлений и 1 удалений

Просмотреть файл

@ -269,7 +269,8 @@ bool GrClipStackClip::apply(GrContext* context, GrDrawContext* drawContext, bool
}
SkRect devBounds = SkRect::MakeIWH(drawContext->width(), drawContext->height());
if (!devBounds.intersect(out->clippedDrawBounds())) {
if (!devBounds.intersect(out->clippedDrawBounds()) ||
GrClip::GetPixelIBounds(devBounds).isEmpty()) {
return false;
}

Просмотреть файл

@ -8,6 +8,7 @@
#include "SkLua.h"
#if SK_SUPPORT_GPU
#include "GrClip.h"
#include "GrReducedClip.h"
#endif
@ -642,6 +643,8 @@ int SkLua::lcanvas_getReducedClipStack(lua_State* L) {
#if SK_SUPPORT_GPU
const SkCanvas* canvas = get_ref<SkCanvas>(L, 1);
SkRect queryBounds = SkRect::Make(canvas->getTopLayerBounds());
SkASSERT(!GrClip::GetPixelIBounds(queryBounds).isEmpty());
const GrReducedClip reducedClip(*canvas->getClipStack(), queryBounds);
GrReducedClip::ElementList::Iter iter(reducedClip.elements());