2010-01-31 Eric Carlson <eric.carlson@apple.com>

        Revert r54095 because it caused many media tests to fail.

        * platform/graphics/win/GraphicsLayerCACF.cpp:
        (WebCore::GraphicsLayerCACF::setContentsToVideo):
        (WebCore::GraphicsLayerCACF::updateContentsVideo):
        * platform/graphics/win/GraphicsLayerCACF.h:
        (WebCore::GraphicsLayerCACF::):
        * platform/graphics/win/QTMovieWin.cpp:
        (QTMovieWinPrivate::task):
        (QTMovieWinPrivate::setSize):



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