[Webkit-unassigned] [Bug 37069] [chromium] DragImage implementation for mac

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Apr 6 14:33:10 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=37069





--- Comment #10 from Nico Weber <thakis at chromium.org>  2010-04-06 14:33:10 PST ---
> We usually only need to specify flags or byte ordering if we're hammering at
> the bitmap that we're creating. Since we're going straight to a CGImage, we
> probably don't need to specify anything special here. (And ditto for several
> similar uses below.)

Yes, but it's customary to specify this anyway. It's consistent if nothing
else:

$ ack 'CGImageCreate\(' third_party/WebKit/WebCore/

> > +    if (!context)
> > +        return 0;
> > +    CGContextDrawImage(context, CGRectMake(0, 0, width, height), image);
> > +    CGImageRelease(image);
> 
> I'm not familiar with the ownership context. Is the caller relinquishing
> ownership in a call named scaleDragImage? (And ditto for several similar uses
> below.)

Yes, as far as I understand the code. This is called roughly like the following
in WebCore/page/DragController.cpp: 

void DragController::doImageDrag() {
  ...
  dragImage = createDragImageFromImage(image));
  ...
  dragImage = fitDragImageToMaxSize(dragImage, rect.size(),
maxDragImageSize());  // calls the scale method
  ...
  deleteDragImage(dragImage);
}

This means the scale method needs to delete its argument. The windows version
of the class does that too.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list