Skip to content
Permalink
Browse files

Merge PR #2364: overlay: optimize blit() to not perform a blit if the…

… active item rect is empty.
  • Loading branch information...
mkrautz committed Jul 2, 2016
2 parents daba32f + 8272e48 commit 52a762442b374ae7bc6118a77d9ee769911bbcb9
Showing with 6 additions and 4 deletions.
  1. +1 −1 overlay/d3d10.cpp
  2. +1 −1 overlay/d3d11.cpp
  3. +1 −1 overlay/d3d9.cpp
  4. +3 −1 overlay/lib.cpp
@@ -109,7 +109,7 @@ void D10State::blit(unsigned int x, unsigned int y, unsigned int w, unsigned int

ods("D3D10: Blit %d %d %d %d", x, y, w, h);

if (! pTexture || ! pSRView)
if (! pTexture || ! pSRView || uiLeft == uiRight)
return;

D3D10_MAPPED_TEXTURE2D mappedTex;
@@ -140,7 +140,7 @@ void D11State::blit(unsigned int x, unsigned int y, unsigned int w, unsigned int

ods("D3D11: Blit %d %d %d %d", x, y, w, h);

if (! pTexture || ! pSRView)
if (! pTexture || ! pSRView || uiLeft == uiRight)
return;

D3D11_MAPPED_SUBRESOURCE mappedTex;
@@ -114,7 +114,7 @@ void DevState::blit(unsigned int x, unsigned int y, unsigned int w, unsigned int
ods("D3D9: Blit %d %d %d %d", x, y, w, h);
#endif

if (! texTexture || !a_ucTexture)
if (! texTexture || !a_ucTexture || uiLeft == uiRight)
return;

D3DLOCKED_RECT lr;
@@ -298,8 +298,10 @@ void Pipe::checkMessage(unsigned int width, unsigned int height) {
uiTop = omMsg.oma.y;
uiRight = omMsg.oma.x + omMsg.oma.w;
uiBottom = omMsg.oma.y + omMsg.oma.h;
if (a_ucTexture)
if (a_ucTexture) {
setRect();
blit(0, 0, uiWidth, uiHeight);
}
}
break;
default:

0 comments on commit 52a7624

Please sign in to comment.
You can’t perform that action at this time.