Bug 79651 - [GTK] Crop support in BitmapImage
Summary: [GTK] Crop support in BitmapImage
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 77087
  Show dependency treegraph
 
Reported: 2012-02-27 02:10 PST by Philippe Normand
Modified: 2012-03-06 09:39 PST (History)
3 users (show)

See Also:


Attachments
Crop support in BitmapImage (2.80 KB, patch)
2012-02-27 02:13 PST, Philippe Normand
mrobinson: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Philippe Normand 2012-02-27 02:10:45 PST
I'm not sure it's doable already.

What I need to do when painting an Image surface from a source rectangle to a destination rectangle is to select only a region of the source rectangle.

I'll attach a patch for ImageCairo.
Comment 1 Philippe Normand 2012-02-27 02:13:44 PST
Created attachment 128991 [details]
Crop support in BitmapImage
Comment 2 Martin Robinson 2012-02-27 08:54:07 PST
Comment on attachment 128991 [details]
Crop support in BitmapImage

Is this used anywhere?
Comment 3 Philippe Normand 2012-02-27 08:57:00 PST
(In reply to comment #2)
> (From update of attachment 128991 [details])
> Is this used anywhere?

In the patch of bug 77087 :)
I'm not sure this is the right approach though, I did this as an experiment and it seems to work but my knowledge of the Cairo stuff is a bit limited.
Comment 4 Philippe Normand 2012-03-06 02:11:48 PST
Alex, what do you think about this?
Comment 5 Martin Robinson 2012-03-06 06:56:00 PST
(In reply to comment #4)
> Alex, what do you think about this?

Perhaps ::crop could me a method on ImageGstreamer. Then you could just adjust the srcRect you pass into Image::draw.
Comment 6 Martin Robinson 2012-03-06 06:57:13 PST
Comment on attachment 128991 [details]
Crop support in BitmapImage

I think perhaps platform-independent Image is the wrong place for this. :/ Also it seems like a change like this should just go in the patch that depends on it -- instead of introducing code that is totally dead. Perhaps we can chat about another design.
Comment 7 Philippe Normand 2012-03-06 07:31:07 PST
(In reply to comment #5)
> (In reply to comment #4)
> > Alex, what do you think about this?
> 
> Perhaps ::crop could me a method on ImageGstreamer. Then you could just adjust the srcRect you pass into Image::draw.

the rect in MediaPlayerPrivateGStreamer::paint() is the destination rectangle, I think. Not the source rectangle. What I need to crop is the source.
Comment 8 Philippe Normand 2012-03-06 09:39:31 PST
Will do as Martin suggests. Thanks!