Bug 22790

Summary: [Transforms] MediaPlayer::setRect() makes no sense with transforms
Product: WebKit Reporter: Simon Fraser (smfr) <simon.fraser>
Component: Layout and RenderingAssignee: Eric Carlson <eric.carlson>
Status: RESOLVED FIXED    
Severity: Normal CC: eric.carlson, koivisto
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.5   
Bug Depends on:    
Bug Blocks: 15670    
Attachments:
Description Flags
proposed patch simon.fraser: review+

Description Simon Fraser (smfr) 2008-12-10 10:56:14 PST
MediaPlayer has a setRect() method. However, this implies that the video is not rotated, so it makes no sense if there is a transform on the video, or an ancestor.
Comment 1 Eric Carlson 2009-03-06 10:28:14 PST
Created attachment 28366 [details]
proposed patch
Comment 2 Simon Fraser (smfr) 2009-03-06 10:37:03 PST
Comment on attachment 28366 [details]
proposed patch

> Index: WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp
> ===================================================================

> -    //TODO: m_rect vs rect?
> +    //TODO: m_size vs rect?

Is the TODO still applicable?

> Index: WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h
> ===================================================================

> +    IntRect m_rect;

I have a minor preference for just storing a size in the member var,
and constructing a (0,0,size) rect where you need one.

> Index: WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm

> +    , m_rect(IntRect())

No need to initialize. IntRect has a ctor.

> +    	if (m_player->inMediaDocument() && r != m_rect) {
> +			// the QTMovieView needs to be placed in the proper location for document mode
> +        	m_rect = r;
> +			[view setFrame:m_rect];

Tabs here?

r=me with those comments addressed.
Comment 3 Eric Carlson 2009-03-06 10:52:12 PST
>> Index: WebCore/platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp
>> ===================================================================
>>
>> -    //TODO: m_rect vs rect?
>> +    //TODO: m_size vs rect?
>
> Is the TODO still applicable?

I don't know if it is still applicable so I left the comment.

>> Index: WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h
>> ===================================================================
>>
>> +    IntRect m_rect;
>
>I have a minor preference for just storing a size in the member var,
>and constructing a (0,0,size) rect where you need one.

It make sense to store the Rect passed to  paint() when we are in a media
document so I think I will leave the member var as a rect
Comment 4 Eric Carlson 2009-03-06 11:10:12 PST
http://trac.webkit.org/changeset/41486