OSDN Git Service

Fix plugin rendering bug when video surface is not ready.
[android-x86/external-webkit.git] / Source / WebCore / platform / graphics / android / MediaTexture.cpp
index 98dca22..1676186 100644 (file)
@@ -70,7 +70,8 @@ MediaTexture::MediaTexture(jobject webViewRef) : android::LightRefBase<MediaText
 
 MediaTexture::~MediaTexture()
 {
-    deleteTexture(m_contentTexture);
+    if (m_contentTexture)
+        deleteTexture(m_contentTexture, true);
     for (unsigned int i = 0; i < m_videoTextures.size(); i++) {
         deleteTexture(m_videoTextures[i], true);
     }
@@ -158,7 +159,7 @@ void MediaTexture::draw(const TransformationMatrix& contentMatrix,
 
         if (!video->surfaceTexture.get() || video->dimensions.isEmpty()
                 || !video->mediaListener->isFrameAvailable())
-            return;
+            continue;
 
         video->surfaceTexture->updateTexImage();