Remove redundant check for negative values when using WebCore::Color::alpha()
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Aug 2012 18:28:23 +0000 (18:28 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Aug 2012 18:28:23 +0000 (18:28 +0000)
commit30c932c726157a3c0600b61c262fca9529c8598c
treeb55effffde969096086fc2a5da19743314f0c7fc
parent4525142b0eba93663d727b92ed5491cb3133c1a9
Remove redundant check for negative values when using WebCore::Color::alpha()
https://bugs.webkit.org/show_bug.cgi?id=94811

Patch by Bruno de Oliveira Abinader <bruno.abinader@basyskom.com> on 2012-08-23
Reviewed by Eric Seidel.

Though alpha() returns a signed value (int), its value is stored on an unsigned
typedef (RGBA32) and is safeguarded by alphaChannel() that its value never goes
beyond 255, so no integer overflow, thus we can safely remove redundant check
for negative values while using it.

This change does not affect behavior, so no new tests needed.

* platform/graphics/Image.cpp:
(WebCore::Image::fillWithSolidColor):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintFillLayerExtended):
(WebCore::RenderBoxModelObject::boxShadowShouldBeAppliedToBackground): Using hasAlpha() for readibility.
* rendering/RenderView.cpp:
(WebCore::RenderView::paintBoxDecorations):
* rendering/style/RenderStyle.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@126452 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/Image.cpp
Source/WebCore/rendering/RenderBoxModelObject.cpp
Source/WebCore/rendering/RenderView.cpp
Source/WebCore/rendering/style/RenderStyle.h