Commit b3474d9d by Olli Etuaho Committed by Commit Bot

Clean up ClipRectangle

It's not necessary to set the intersection rectangle in case the intersection is empty. BUG=chromium:830046 TEST=angle_end2end_tests Change-Id: I0b99cdb7d6623b2d8a95dbe946a6eead6a44351d Reviewed-on: https://chromium-review.googlesource.com/1021695Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
parent 8d5571ac
...@@ -202,18 +202,8 @@ bool ClipRectangle(const Rectangle &source, const Rectangle &clip, Rectangle *in ...@@ -202,18 +202,8 @@ bool ClipRectangle(const Rectangle &source, const Rectangle &clip, Rectangle *in
if (minSourceX >= maxClipX || maxSourceX <= minClipX || minSourceY >= maxClipY || maxSourceY <= minClipY) if (minSourceX >= maxClipX || maxSourceX <= minClipX || minSourceY >= maxClipY || maxSourceY <= minClipY)
{ {
if (intersection)
{
intersection->x = minSourceX;
intersection->y = maxSourceY;
intersection->width = maxSourceX - minSourceX;
intersection->height = maxSourceY - minSourceY;
}
return false; return false;
} }
else
{
if (intersection) if (intersection)
{ {
intersection->x = std::max(minSourceX, minClipX); intersection->x = std::max(minSourceX, minClipX);
...@@ -221,9 +211,7 @@ bool ClipRectangle(const Rectangle &source, const Rectangle &clip, Rectangle *in ...@@ -221,9 +211,7 @@ bool ClipRectangle(const Rectangle &source, const Rectangle &clip, Rectangle *in
intersection->width = std::min(maxSourceX, maxClipX) - std::max(minSourceX, minClipX); intersection->width = std::min(maxSourceX, maxClipX) - std::max(minSourceX, minClipX);
intersection->height = std::min(maxSourceY, maxClipY) - std::max(minSourceY, minClipY); intersection->height = std::min(maxSourceY, maxClipY) - std::max(minSourceY, minClipY);
} }
return true; return true;
}
} }
bool Box::operator==(const Box &other) const bool Box::operator==(const Box &other) const
......
...@@ -1498,7 +1498,10 @@ gl::Error Blit11::copyAndConvertImpl(const TextureHelper11 &source, ...@@ -1498,7 +1498,10 @@ gl::Error Blit11::copyAndConvertImpl(const TextureHelper11 &source,
// Clip dest area to the scissor // Clip dest area to the scissor
if (scissor) if (scissor)
{ {
gl::ClipRectangle(clipRect, *scissor, &clipRect); if (!gl::ClipRectangle(clipRect, *scissor, &clipRect))
{
return gl::NoError();
}
} }
convertFunction(sourceArea, destArea, clipRect, sourceSize, sourceMapping.RowPitch, convertFunction(sourceArea, destArea, clipRect, sourceSize, sourceMapping.RowPitch,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment