Disable plugin content copy when 0x0 pixels
bug:5382635
Change-Id: I83f999d9e2dd0dc51a6c2f780f2f2b7add95a60a
diff --git a/samples/BrowserPlugin/jni/RenderingThread.cpp b/samples/BrowserPlugin/jni/RenderingThread.cpp
index 91ffb4a..1307e90 100644
--- a/samples/BrowserPlugin/jni/RenderingThread.cpp
+++ b/samples/BrowserPlugin/jni/RenderingThread.cpp
@@ -43,9 +43,14 @@
}
android::status_t RenderingThread::readyToRun() {
+ gLogI.log(kError_ANPLogType, "thread %p acquiring native window...", this);
while (m_ANW == NULL) {
m_ANW = gNativeWindowI.acquireNativeWindow(m_npp);
+ if (!m_ANW)
+ gLogI.log(kError_ANPLogType, "thread %p acquire native window FAILED!", this);
+
}
+ gLogI.log(kError_ANPLogType, "thread %p acquired native window successfully!", this);
#if (!USE_SOFTWARE_RENDERING)
m_eglDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
@@ -165,6 +170,8 @@
const SkBitmap& bitmap)
{
#if USE_SOFTWARE_RENDERING
+ if (bitmap.height() == 0 || bitmap.width() == 0)
+ return;
//STEP 1: lock the ANW, getting a buffer
ANativeWindow_Buffer buffer;