summaryrefslogtreecommitdiffstats
path: root/WebKit
diff options
context:
space:
mode:
authorTeng-Hui Zhu <ztenghui@google.com>2011-03-18 15:41:20 -0700
committerTeng-Hui Zhu <ztenghui@google.com>2011-03-21 10:36:34 -0700
commitde89b1aa0a100f46600ed48b6b3b57759c446447 (patch)
tree20483b9dd04dad855710275a7674cf6fad37d967 /WebKit
parente1c3e59945c9789e93c417e064a9abed1057ce42 (diff)
downloadexternal_webkit-de89b1aa0a100f46600ed48b6b3b57759c446447.zip
external_webkit-de89b1aa0a100f46600ed48b6b3b57759c446447.tar.gz
external_webkit-de89b1aa0a100f46600ed48b6b3b57759c446447.tar.bz2
Support drawing paused and loading image as GL texture
bug:4142131 Change-Id: I871924cb7587077f50fdf4f9a00056f795a8daea
Diffstat (limited to 'WebKit')
-rw-r--r--WebKit/android/RenderSkinMediaButton.cpp17
-rw-r--r--WebKit/android/RenderSkinMediaButton.h5
-rw-r--r--WebKit/android/WebCoreSupport/MediaPlayerPrivateAndroid.cpp6
3 files changed, 19 insertions, 9 deletions
diff --git a/WebKit/android/RenderSkinMediaButton.cpp b/WebKit/android/RenderSkinMediaButton.cpp
index 6a11eda..745fa88 100644
--- a/WebKit/android/RenderSkinMediaButton.cpp
+++ b/WebKit/android/RenderSkinMediaButton.cpp
@@ -54,9 +54,12 @@ static const PatchData gFiles[] =
{ "ic_media_rew.png", 0, 0 }, // REWIND
{ "ic_media_ff.png", 0, 0 }, // FORWARD
{ "ic_media_fullscreen.png", 0, 0 }, // FULLSCREEN
+ { "spinner_76_outer_holo.png", 0, 0 }, // SPINNER_OUTER
+ { "spinner_76_inner_holo.png", 0, 0 }, // SPINNER_INNER
+ { "ic_media_video_poster.png", 0, 0 }, // VIDEO
{ "btn_media_player_disabled.9.png", 0, 0 }, // BACKGROUND_SLIDER
- { "scrubber_track_holo_dark.9.png", 0, 0 }, // SLIDER_TRACK
- { "scrubber_control_holo.png", 0, 0 } // SLIDER_THUMB
+ { "scrubber_track_holo_dark.9.png", 0, 0 }, // SLIDER_TRACK
+ { "scrubber_control_holo.png", 0, 0 } // SLIDER_THUMB
};
static SkBitmap gButton[sizeof(gFiles)/sizeof(gFiles[0])];
@@ -124,6 +127,14 @@ void RenderSkinMediaButton::Draw(SkCanvas* canvas, const IntRect& r, int buttonT
paint.setColor(backgroundColor);
break;
}
+ case SPINNER_OUTER:
+ case SPINNER_INNER:
+ case VIDEO:
+ {
+ drawsBackgroundColor = false;
+ imageIndex = buttonType + 1;
+ break;
+ }
case BACKGROUND_SLIDER:
{
drawsBackgroundColor = false;
@@ -200,4 +211,4 @@ void RenderSkinMediaButton::Draw(SkCanvas* canvas, const IntRect& r, int buttonT
}
}
-} //WebCore
+} // WebCore
diff --git a/WebKit/android/RenderSkinMediaButton.h b/WebKit/android/RenderSkinMediaButton.h
index 026f538..6aa9c4e 100644
--- a/WebKit/android/RenderSkinMediaButton.h
+++ b/WebKit/android/RenderSkinMediaButton.h
@@ -34,8 +34,7 @@ namespace WebCore {
class IntRect;
class RenderObject;
-class RenderSkinMediaButton
-{
+class RenderSkinMediaButton {
public:
/**
* Initialize the class before use. Uses the AssetManager to initialize any
@@ -51,7 +50,7 @@ public:
/**
* Button types
*/
- enum { PAUSE, PLAY, MUTE, REWIND, FORWARD, FULLSCREEN, BACKGROUND_SLIDER, SLIDER_TRACK, SLIDER_THUMB };
+ enum { PAUSE, PLAY, MUTE, REWIND, FORWARD, FULLSCREEN, SPINNER_OUTER, SPINNER_INNER , VIDEO, BACKGROUND_SLIDER, SLIDER_TRACK, SLIDER_THUMB };
/**
* Slider dimensions
*/
diff --git a/WebKit/android/WebCoreSupport/MediaPlayerPrivateAndroid.cpp b/WebKit/android/WebCoreSupport/MediaPlayerPrivateAndroid.cpp
index 4cc9cf4..d61b0dd 100644
--- a/WebKit/android/WebCoreSupport/MediaPlayerPrivateAndroid.cpp
+++ b/WebKit/android/WebCoreSupport/MediaPlayerPrivateAndroid.cpp
@@ -567,7 +567,7 @@ static void OnTimeupdate(JNIEnv* env, jobject obj, int position, int pointer)
// Return value: true when the video layer is found.
static bool SendSurfaceTexture(JNIEnv* env, jobject obj, jobject surfTex,
int baseLayer, int videoLayerId,
- int textureName, bool updateTexture) {
+ int textureName, int playerState) {
if (!surfTex)
return false;
@@ -590,7 +590,7 @@ static bool SendSurfaceTexture(JNIEnv* env, jobject obj, jobject surfTex,
return false;
// Set the SurfaceTexture to the layer we found
- videoLayer->setSurfaceTexture(texture, textureName, updateTexture);
+ videoLayer->setSurfaceTexture(texture, textureName, static_cast<PlayerState>(playerState));
return true;
}
@@ -607,7 +607,7 @@ static JNINativeMethod g_MediaPlayerMethods[] = {
(void*) OnPaused },
{ "nativeOnPosterFetched", "(Landroid/graphics/Bitmap;I)V",
(void*) OnPosterFetched },
- { "nativeSendSurfaceTexture", "(Landroid/graphics/SurfaceTexture;IIIZ)Z",
+ { "nativeSendSurfaceTexture", "(Landroid/graphics/SurfaceTexture;IIII)Z",
(void*) SendSurfaceTexture },
{ "nativeOnTimeupdate", "(II)V",
(void*) OnTimeupdate },