Kaydet (Commit) a7b932dd authored tarafından Tor Lillqvist's avatar Tor Lillqvist

AndroidSalInstance::RedrawWindows() is called from only one place

No need to take a parameter for which NULL is always passed, and related
simplifications.

Change-Id: I89bab2904fdae3520987d0f67e55b2649bf225d3
üst 4994ccd7
...@@ -117,24 +117,9 @@ void AndroidSalInstance::BlitFrameToWindow(ANativeWindow_Buffer *pOutBuffer, ...@@ -117,24 +117,9 @@ void AndroidSalInstance::BlitFrameToWindow(ANativeWindow_Buffer *pOutBuffer,
BlitFrameRegionToWindow(pOutBuffer, aDev, aWhole, 0, 0); BlitFrameRegionToWindow(pOutBuffer, aDev, aWhole, 0, 0);
} }
void AndroidSalInstance::RedrawWindows(ANativeWindow *pWindow, ANativeWindow_Buffer *pBuffer) void AndroidSalInstance::RedrawWindows(ANativeWindow_Buffer *pBuffer)
{ {
ANativeWindow_Buffer aOutBuffer; if (pBuffer->bits != NULL)
memset ((void *)&aOutBuffer, 0, sizeof (aOutBuffer));
if (pBuffer != NULL)
aOutBuffer = *pBuffer;
else
{
if (!pWindow)
return;
// ARect aRect;
LOGI("pre lock #3");
ANativeWindow_lock(pWindow, &aOutBuffer, NULL);
}
if (aOutBuffer.bits != NULL)
{ {
int i = 0; int i = 0;
std::list< SalFrame* >::const_iterator it; std::list< SalFrame* >::const_iterator it;
...@@ -144,15 +129,12 @@ void AndroidSalInstance::RedrawWindows(ANativeWindow *pWindow, ANativeWindow_Buf ...@@ -144,15 +129,12 @@ void AndroidSalInstance::RedrawWindows(ANativeWindow *pWindow, ANativeWindow_Buf
if (pFrame->IsVisible()) if (pFrame->IsVisible())
{ {
BlitFrameToWindow (&aOutBuffer, pFrame->getDevice()); BlitFrameToWindow (pBuffer, pFrame->getDevice());
} }
} }
} }
else else
LOGI("no buffer for locked window"); LOGI("no buffer for locked window");
if (pBuffer && pWindow)
ANativeWindow_unlockAndPost(pWindow);
} }
void AndroidSalInstance::damaged(AndroidSalFrame */* frame */) void AndroidSalInstance::damaged(AndroidSalFrame */* frame */)
...@@ -471,7 +453,7 @@ typedef struct ANativeWindow_Buffer { ...@@ -471,7 +453,7 @@ typedef struct ANativeWindow_Buffer {
dummyOut.stride = info.stride / 4; // sigh ! dummyOut.stride = info.stride / 4; // sigh !
dummyOut.format = info.format; dummyOut.format = info.format;
dummyOut.bits = pixels; dummyOut.bits = pixels;
AndroidSalInstance::getInstance()->RedrawWindows (NULL, &dummyOut); AndroidSalInstance::getInstance()->RedrawWindows (&dummyOut);
AndroidBitmap_unlockPixels(env, bitmap); AndroidBitmap_unlockPixels(env, bitmap);
} }
......
...@@ -62,7 +62,7 @@ public: ...@@ -62,7 +62,7 @@ public:
// mainloop pieces // mainloop pieces
virtual bool AnyInput( sal_uInt16 nType ); virtual bool AnyInput( sal_uInt16 nType );
void RedrawWindows(ANativeWindow *pWindow, ANativeWindow_Buffer *pBuffer = NULL); void RedrawWindows(ANativeWindow_Buffer *pBuffer);
SalFrame *getFocusFrame() const; SalFrame *getFocusFrame() const;
void damaged(AndroidSalFrame *frame); void damaged(AndroidSalFrame *frame);
......
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