Re: [webkit-dev] Proposed Windows Drawing Change (WebNodeHighlight) Logic

2011-06-27 Thread Brent Fulgham
On Mon, Jun 27, 2011 at 5:36 AM, Adam Roben  wrote:
> On Jun 27, 2011, at 1:55 AM, Simon Fraser wrote:
>
>> This should go into a bug.
>
> Agreed.

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

Thanks,

-Brent
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


Re: [webkit-dev] Proposed Windows Drawing Change (WebNodeHighlight) Logic

2011-06-27 Thread Adam Roben
On Jun 27, 2011, at 1:55 AM, Simon Fraser wrote:

> This should go into a bug.

Agreed.

> On Jun 26, 2011, at 4:12 PM, Brent Fulgham wrote:
> 
>> While investigating a separate issue, I noticed that I was hitting an 
>> assertion in the Cairo drawing layer because it was attempting to use an 
>> invalid HBITMAP created in the WebNodeHighlight::update method.  The 
>> underlying issue was that the CreateDIBSection function was failing, because 
>> it was being requested to create a section of zero height.
>> 
>> I think the following change would be safe for the CoreGraphics and Cairo 
>> ports, but wanted to see if anyone knew of a reason why it would be bad to 
>> exit early in the case of a zero height (or zero width) paint region.
>> 
>> $ svn diff
>> Index: win/WebNodeHighlight.cpp
>> ===
>> --- win/WebNodeHighlight.cpp(revision 89759)
>> +++ win/WebNodeHighlight.cpp(working copy)
>> @@ -145,10 +145,14 @@
>>size.cx = webViewRect.right - webViewRect.left;
>>size.cy = webViewRect.bottom - webViewRect.top;
>> 
>> +if (!size.cx || !size.cy)
>> +return;
>> +
>>BitmapInfo bitmapInfo = BitmapInfo::createBottomUp(IntSize(size));
>> 
>>void* pixels = 0;
>>OwnPtr hbmp = adoptPtr(::CreateDIBSection(hdc, &bitmapInfo, 
>> DIB_RG
>> B_COLORS, &pixels, 0, 0));
>> +ASSERT_WITH_MESSAGE(hbmp.get(), "::CreateDIBSection failed with error 
>> %lu",
>> ::GetLastError());
>> 
>>::SelectObject(hdc, hbmp.get());

I don't see any reason why this would be bad.

-Adam

___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


Re: [webkit-dev] Proposed Windows Drawing Change (WebNodeHighlight) Logic

2011-06-26 Thread Simon Fraser
This should go into a bug.

Simon

On Jun 26, 2011, at 4:12 PM, Brent Fulgham wrote:

> While investigating a separate issue, I noticed that I was hitting an 
> assertion in the Cairo drawing layer because it was attempting to use an 
> invalid HBITMAP created in the WebNodeHighlight::update method.  The 
> underlying issue was that the CreateDIBSection function was failing, because 
> it was being requested to create a section of zero height.
> 
> I think the following change would be safe for the CoreGraphics and Cairo 
> ports, but wanted to see if anyone knew of a reason why it would be bad to 
> exit early in the case of a zero height (or zero width) paint region.
> 
> $ svn diff
> Index: win/WebNodeHighlight.cpp
> ===
> --- win/WebNodeHighlight.cpp(revision 89759)
> +++ win/WebNodeHighlight.cpp(working copy)
> @@ -145,10 +145,14 @@
> size.cx = webViewRect.right - webViewRect.left;
> size.cy = webViewRect.bottom - webViewRect.top;
> 
> +if (!size.cx || !size.cy)
> +return;
> +
> BitmapInfo bitmapInfo = BitmapInfo::createBottomUp(IntSize(size));
> 
> void* pixels = 0;
> OwnPtr hbmp = adoptPtr(::CreateDIBSection(hdc, &bitmapInfo, 
> DIB_RG
> B_COLORS, &pixels, 0, 0));
> +ASSERT_WITH_MESSAGE(hbmp.get(), "::CreateDIBSection failed with error 
> %lu",
> ::GetLastError());
> 
> ::SelectObject(hdc, hbmp.get());
> 
> Thanks,
> 
> -Brent
> 
> ___
> webkit-dev mailing list
> webkit-dev@lists.webkit.org
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


[webkit-dev] Proposed Windows Drawing Change (WebNodeHighlight) Logic

2011-06-26 Thread Brent Fulgham
While investigating a separate issue, I noticed that I was hitting an assertion 
in the Cairo drawing layer because it was attempting to use an invalid HBITMAP 
created in the WebNodeHighlight::update method.  The underlying issue was that 
the CreateDIBSection function was failing, because it was being requested to 
create a section of zero height.

I think the following change would be safe for the CoreGraphics and Cairo 
ports, but wanted to see if anyone knew of a reason why it would be bad to exit 
early in the case of a zero height (or zero width) paint region.

$ svn diff
Index: win/WebNodeHighlight.cpp
===
--- win/WebNodeHighlight.cpp(revision 89759)
+++ win/WebNodeHighlight.cpp(working copy)
@@ -145,10 +145,14 @@
 size.cx = webViewRect.right - webViewRect.left;
 size.cy = webViewRect.bottom - webViewRect.top;

+if (!size.cx || !size.cy)
+return;
+
 BitmapInfo bitmapInfo = BitmapInfo::createBottomUp(IntSize(size));

 void* pixels = 0;
 OwnPtr hbmp = adoptPtr(::CreateDIBSection(hdc, &bitmapInfo, DIB_RG
B_COLORS, &pixels, 0, 0));
+ASSERT_WITH_MESSAGE(hbmp.get(), "::CreateDIBSection failed with error %lu",
 ::GetLastError());

 ::SelectObject(hdc, hbmp.get());

Thanks,

-Brent

___
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev