Commit 0a89bdd6 authored by mrowe@apple.com's avatar mrowe@apple.com

Revert r54114 since it made a mess of the ChangeLog.

git-svn-id: svn://svn.chromium.org/blink/trunk@54115 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 1ffe9423
This diff is collapsed.
...@@ -364,21 +364,18 @@ void GraphicsLayerCACF::setContentsToImage(Image* image) ...@@ -364,21 +364,18 @@ void GraphicsLayerCACF::setContentsToImage(Image* image)
updateSublayerList(); updateSublayerList();
} }
void GraphicsLayerCACF::setContentsToVideo(PlatformLayer* videoLayer) void GraphicsLayerCACF::setContentsToMedia(PlatformLayer* mediaLayer)
{ {
bool childrenChanged = false; if (mediaLayer == m_contentsLayer)
return;
if (videoLayer != m_contentsLayer.get())
childrenChanged = true;
m_contentsLayer = videoLayer; m_contentsLayer = mediaLayer;
m_contentsLayerPurpose = videoLayer ? ContentsLayerForVideo : NoContentsLayer; m_contentsLayerPurpose = mediaLayer ? ContentsLayerForMedia : NoContentsLayer;
updateContentsVideo(); updateContentsMedia();
// This has to happen after updateContentsVideo // This has to happen after updateContentsMedia
if (childrenChanged) updateSublayerList();
updateSublayerList();
} }
void GraphicsLayerCACF::setGeometryOrientation(CompositingCoordinatesOrientation orientation) void GraphicsLayerCACF::setGeometryOrientation(CompositingCoordinatesOrientation orientation)
...@@ -633,9 +630,9 @@ void GraphicsLayerCACF::updateContentsImage() ...@@ -633,9 +630,9 @@ void GraphicsLayerCACF::updateContentsImage()
} }
} }
void GraphicsLayerCACF::updateContentsVideo() void GraphicsLayerCACF::updateContentsMedia()
{ {
// Video layer was set as m_contentsLayer, and will get parented in updateSublayerList(). // Media layer was set as m_contentsLayer, and will get parented in updateSublayerList().
if (m_contentsLayer) { if (m_contentsLayer) {
setupContentsLayer(m_contentsLayer.get()); setupContentsLayer(m_contentsLayer.get());
updateContentsRect(); updateContentsRect();
......
...@@ -82,7 +82,7 @@ public: ...@@ -82,7 +82,7 @@ public:
virtual void setContentsRect(const IntRect&); virtual void setContentsRect(const IntRect&);
virtual void setContentsToImage(Image*); virtual void setContentsToImage(Image*);
virtual void setContentsToVideo(PlatformLayer*); virtual void setContentsToMedia(PlatformLayer*);
virtual PlatformLayer* platformLayer() const; virtual PlatformLayer* platformLayer() const;
...@@ -115,7 +115,7 @@ private: ...@@ -115,7 +115,7 @@ private:
void updateLayerBackgroundColor(); void updateLayerBackgroundColor();
void updateContentsImage(); void updateContentsImage();
void updateContentsVideo(); void updateContentsMedia();
void updateContentsRect(); void updateContentsRect();
void updateGeometryOrientation(); void updateGeometryOrientation();
...@@ -129,7 +129,7 @@ private: ...@@ -129,7 +129,7 @@ private:
enum ContentsLayerPurpose { enum ContentsLayerPurpose {
NoContentsLayer = 0, NoContentsLayer = 0,
ContentsLayerForImage, ContentsLayerForImage,
ContentsLayerForVideo ContentsLayerForMedia
}; };
ContentsLayerPurpose m_contentsLayerPurpose; ContentsLayerPurpose m_contentsLayerPurpose;
......
...@@ -99,6 +99,7 @@ public: ...@@ -99,6 +99,7 @@ public:
void deleteGWorld(); void deleteGWorld();
void clearGWorld(); void clearGWorld();
void cacheMovieScale(); void cacheMovieScale();
void updateMovieSize();
void setSize(int, int); void setSize(int, int);
...@@ -259,14 +260,16 @@ void QTMovieWinPrivate::task() ...@@ -259,14 +260,16 @@ void QTMovieWinPrivate::task()
// we only need to erase the movie gworld when the load state changes to loaded while it // we only need to erase the movie gworld when the load state changes to loaded while it
// is visible as the gworld is destroyed/created when visibility changes // is visible as the gworld is destroyed/created when visibility changes
bool shouldRestorePlaybackState = false; bool shouldRestorePlaybackState = false;
if (loadState >= QTMovieLoadStateLoaded && m_loadState < QTMovieLoadStateLoaded) { bool movieNewlyPlayable = loadState >= QTMovieLoadStateLoaded && m_loadState < QTMovieLoadStateLoaded;
m_loadState = loadState;
if (movieNewlyPlayable) {
updateMovieSize();
if (m_visible) if (m_visible)
clearGWorld(); clearGWorld();
cacheMovieScale(); cacheMovieScale();
shouldRestorePlaybackState = true; shouldRestorePlaybackState = true;
} }
m_loadState = loadState;
if (!m_movieController && m_loadState >= QTMovieLoadStateLoaded) if (!m_movieController && m_loadState >= QTMovieLoadStateLoaded)
createMovieController(); createMovieController();
m_client->movieLoadStateChanged(m_movieWin); m_client->movieLoadStateChanged(m_movieWin);
...@@ -403,7 +406,6 @@ void QTMovieWinPrivate::clearGWorld() ...@@ -403,7 +406,6 @@ void QTMovieWinPrivate::clearGWorld()
MacSetPort(savePort); MacSetPort(savePort);
} }
void QTMovieWinPrivate::setSize(int width, int height) void QTMovieWinPrivate::setSize(int width, int height)
{ {
if (m_width == width && m_height == height) if (m_width == width && m_height == height)
...@@ -421,17 +423,26 @@ void QTMovieWinPrivate::setSize(int width, int height) ...@@ -421,17 +423,26 @@ void QTMovieWinPrivate::setSize(int width, int height)
ASSERT(m_scaleCached); ASSERT(m_scaleCached);
#endif #endif
updateMovieSize();
}
void QTMovieWinPrivate::updateMovieSize()
{
if (!m_movie || m_loadState < QTMovieLoadStateLoaded)
return;
Rect bounds; Rect bounds;
bounds.top = 0; bounds.top = 0;
bounds.left = 0; bounds.left = 0;
bounds.right = width; bounds.right = m_width;
bounds.bottom = height; bounds.bottom = m_height;
if (m_movieController) if (m_movieController)
MCSetControllerBoundsRect(m_movieController, &bounds); MCSetControllerBoundsRect(m_movieController, &bounds);
SetMovieBox(m_movie, &bounds); SetMovieBox(m_movie, &bounds);
updateGWorld(); updateGWorld();
} }
void QTMovieWinPrivate::deleteGWorld() void QTMovieWinPrivate::deleteGWorld()
{ {
ASSERT(m_gWorld); ASSERT(m_gWorld);
......
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