Make CanvasStyle a plain object instead of an RefCounted object
authorbenjamin@webkit.org <benjamin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 11 May 2013 08:36:42 +0000 (08:36 +0000)
committerbenjamin@webkit.org <benjamin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 11 May 2013 08:36:42 +0000 (08:36 +0000)
commitbe39337e172215928b49a6e476030aae9425b66e
treea2c22398649b617b1d04136d19beba16763926b5
parentb73a8356307089e079435c024d019d97df5d3abd
Make CanvasStyle a plain object instead of an RefCounted object
https://bugs.webkit.org/show_bug.cgi?id=115775

Patch by Benjamin Poulain <bpoulain@apple.com> on 2013-05-11
Reviewed by Andreas Kling.

CanvasStyle is just 2 words wide. We do not gain anything from allocating
it on the heap. Change the object to be just a type and some data.

* bindings/js/JSCanvasRenderingContext2DCustom.cpp:
(WebCore::toJS):
(WebCore::toHTMLCanvasStyle):
* html/HTMLCanvasElement.cpp:
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::State::State):
(WebCore::CanvasRenderingContext2D::setStrokeStyle):
(WebCore::CanvasRenderingContext2D::setFillStyle):
(WebCore::CanvasRenderingContext2D::setStrokeColor):
(WebCore::CanvasRenderingContext2D::setFillColor):
(WebCore::CanvasRenderingContext2D::fullCanvasCompositedFill):
(WebCore::CanvasRenderingContext2D::drawTextInternal):
* html/canvas/CanvasRenderingContext2D.h:
(WebCore::CanvasRenderingContext2D::strokeStyle):
(CanvasRenderingContext2D):
(WebCore::CanvasRenderingContext2D::fillStyle):
(State):
* html/canvas/CanvasStyle.cpp:
(WebCore::CanvasStyle::CanvasStyle):
(WebCore::CanvasStyle::createFromString):
(WebCore::CanvasStyle::createFromStringWithOverrideAlpha):
(WebCore::CanvasStyle::isEquivalentColor):
(WebCore):
(WebCore::CanvasStyle::operator=):
(WebCore::CanvasStyle::applyStrokeColor):
(WebCore::CanvasStyle::applyFillColor):
* html/canvas/CanvasStyle.h:
(CanvasStyle):
(WebCore::CanvasStyle::isValid):
(WebCore::CanvasStyle::CanvasStyle):
(WebCore):
(WebCore::CanvasStyle::operator=):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@149928 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp
Source/WebCore/html/HTMLCanvasElement.cpp
Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp
Source/WebCore/html/canvas/CanvasRenderingContext2D.h
Source/WebCore/html/canvas/CanvasStyle.cpp
Source/WebCore/html/canvas/CanvasStyle.h