ImageBuffer::create should return a std::unique_ptr instead of OwnPtr.
https://bugs.webkit.org/show_bug.cgi?id=124822

Patch by Brian J. Burg <burg@cs.washington.edu> on 2013-11-26
Reviewed by Andreas Kling.

Replace all uses of OwnPtr<ImageBuffer> and PassOwnPtr<ImageBuffer> with
std::unique_ptr<ImageBuffer>. Replace calls to OwnPtr::clear() and
OwnPtr::release() with reset() and std::move(). Remove unnecessary includes.

No new tests. This is a mechanical refactoring.

* css/CSSFilterImageValue.cpp:
(WebCore::CSSFilterImageValue::image):
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::setSurfaceSize):
* html/HTMLCanvasElement.h:
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::createCompositingBuffer):
(WebCore::CanvasRenderingContext2D::fullCanvasCompositedDrawImage):
(WebCore::CanvasRenderingContext2D::fullCanvasCompositedFill):
(WebCore::CanvasRenderingContext2D::drawTextInternal):
* html/canvas/CanvasRenderingContext2D.h:
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::LRUImageBufferCache::LRUImageBufferCache):
(WebCore::WebGLRenderingContext::LRUImageBufferCache::imageBuffer):
* html/canvas/WebGLRenderingContext.h:
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage):
* page/Frame.cpp:
(WebCore::Frame::nodeImage):
(WebCore::Frame::dragImageForSelection):
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::drawPattern):
* platform/graphics/CrossfadeGeneratedImage.cpp:
(WebCore::CrossfadeGeneratedImage::drawPattern):
* platform/graphics/GradientImage.h:
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::createCompatibleBuffer):
* platform/graphics/GraphicsContext.h:
* platform/graphics/ImageBuffer.cpp:
(WebCore::ImageBuffer::createCompatibleBuffer):
* platform/graphics/ImageBuffer.h:
(WebCore::ImageBuffer::create):
* platform/graphics/ShadowBlur.cpp:
* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::ImageBuffer::putByteArray):
* platform/graphics/cg/PDFDocumentImage.h:
* platform/graphics/filters/FETile.cpp:
(WebCore::FETile::platformApplySoftware):
* platform/graphics/filters/Filter.h:
(WebCore::Filter::setSourceImage):
* platform/graphics/filters/FilterEffect.cpp:
(WebCore::FilterEffect::clearResult):
* platform/graphics/filters/FilterEffect.h:
* platform/graphics/texmap/TextureMapper.cpp:
(WebCore::BitmapTexture::updateContents):
* platform/graphics/texmap/TextureMapperImageBuffer.h:
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paintDecoration):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintFillLayerExtended):
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::paintProgressBar):
* rendering/shapes/Shape.cpp:
(WebCore::Shape::createShape):
* rendering/svg/RenderSVGImage.cpp:
(WebCore::RenderSVGImage::invalidateBufferedForeground):
* rendering/svg/RenderSVGImage.h:
* rendering/svg/RenderSVGResourceClipper.cpp:
(WebCore::RenderSVGResourceClipper::applyClippingToContext):
* rendering/svg/RenderSVGResourceClipper.h:
* rendering/svg/RenderSVGResourceFilter.cpp:
(WebCore::RenderSVGResourceFilter::applyResource):
(WebCore::RenderSVGResourceFilter::postApplyResource):
* rendering/svg/RenderSVGResourceFilter.h:
* rendering/svg/RenderSVGResourceGradient.cpp: Remove method parameter wrapping/indentation.
(WebCore::createMaskAndSwapContextForTextGradient):
(WebCore::clipToTextMask):
(WebCore::RenderSVGResourceGradient::applyResource):
* rendering/svg/RenderSVGResourceGradient.h:
* rendering/svg/RenderSVGResourceMasker.cpp:
(WebCore::RenderSVGResourceMasker::applyResource):
* rendering/svg/RenderSVGResourceMasker.h:
* rendering/svg/RenderSVGResourcePattern.cpp: Remove method parameter wrapping/indentation.
(WebCore::RenderSVGResourcePattern::buildPattern):
(WebCore::RenderSVGResourcePattern::createTileImage):
* rendering/svg/RenderSVGResourcePattern.h: Remove method parameter wrapping/indentation.
* rendering/svg/SVGRenderingContext.cpp:
(WebCore::SVGRenderingContext::createImageBuffer):
(WebCore::SVGRenderingContext::createImageBufferForPattern):
(WebCore::SVGRenderingContext::clipToImageBuffer):
(WebCore::SVGRenderingContext::bufferForeground):
* rendering/svg/SVGRenderingContext.h:
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::nativeImageForCurrentFrame):
(WebCore::SVGImage::drawPatternForContainer):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159791 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Shapes] Layout using [<box> || <shape>] value
https://bugs.webkit.org/show_bug.cgi?id=124428

Reviewed by David Hyatt.

Source/WebCore:

When a box value is supplied, use it to size and position the shape. Otherwise,
use a default value (content-box for shape-inside, margin-box for shape-outside).
This patch extends the sizing and positioning code used for the box patch (Bug 124227)
to also apply to shapes. With this patch, we also no longer use the box-sizing
property to size and position shapes.

Tests: fast/shapes/shape-outside-floats/shape-outside-shape-boxes-001.html
       fast/shapes/shape-outside-floats/shape-outside-shape-boxes-002.html
       fast/shapes/shape-outside-floats/shape-outside-shape-boxes-003.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue): Adjust for ShapeValues storing
BasicShape::ReferenceBox as their box value, rather than a CSSValueID.
* css/DeprecatedStyleBuilder.cpp:
(WebCore::ApplyPropertyShape::applyValue): Ditto.
* rendering/shapes/ShapeInfo.h:
(WebCore::ShapeInfo::setShapeSize): Adjust for BasicShapes with reference boxes
as well as plain box values. Also, remove old box-sizing code.
(WebCore::ShapeInfo::logicalTopOffset): Ditto.
(WebCore::ShapeInfo::logicalLeftOffset): Ditto.
* rendering/shapes/ShapeInsideInfo.h:
* rendering/shapes/ShapeOutsideInfo.h:
* rendering/style/ShapeValue.h:
(WebCore::ShapeValue::createBoxValue): Adjust for boxes being stored as
BasicShape::ReferenceBoxes.
(WebCore::ShapeValue::box): Ditto.
(WebCore::ShapeValue::ShapeValue): Ditto.

LayoutTests:

Adding tests to make sure that shapes properly size and position themselves across box values
and writing modes. Some shape-outside tests needed to be updated to explicitly size themselves
to content-box, as they were relying on that being the default value. Some shape-inside tests
needed to be adjusted as box-sizing no longer affects the shape size and position.

* csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-circle-001.html:
Explicitly size to content-box.
* csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-margin-001.html: Ditto.
* csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-margin-002.html: Ditto.
* csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-margin-003.html: Ditto.
* csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-margin-004.html: Ditto.
* csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-margin-010.html: Ditto.
* csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-margin-011.html: Ditto.
* csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-margin-012.html: Ditto.
* csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-margin-014.html: Ditto.
* csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-margin-015.html: Ditto.
* csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-margin-016.html: Ditto.
* csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-margin-017.html: Ditto.
* csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-margin-018.html: Ditto.
* csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-margin-021.html: Ditto.
* csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-padding-001.html: Ditto.
* csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-padding-002.html: Ditto.
* csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-padding-003.html: Ditto.
* csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-padding-004.html: Ditto.
* csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-polygon-000.html: Ditto.
* csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-polygon-001.html: Ditto.
* csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-polygon-002.html: Ditto.
* csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-square-border-000.html: Ditto.
* fast/shapes/shape-inside/shape-inside-box-sizing-expected.html: Small test cleanup.
* fast/shapes/shape-inside/shape-inside-box-sizing.html: Modify shapes to provide their sizing box.
* fast/shapes/shape-inside/shape-inside-empty-expected.html: Small test cleanup.
* fast/shapes/shape-inside/shape-inside-empty.html: Modify shapes to provide their sizing box.
* fast/shapes/shape-outside-floats/shape-outside-floats-different-writing-modes.html: Ditto.
* fast/shapes/shape-outside-floats/shape-outside-shape-boxes-001-expected.html: Added.
* fast/shapes/shape-outside-floats/shape-outside-shape-boxes-001.html: Added.
* fast/shapes/shape-outside-floats/shape-outside-shape-boxes-002-expected.html: Added.
* fast/shapes/shape-outside-floats/shape-outside-shape-boxes-002.html: Added.
* fast/shapes/shape-outside-floats/shape-outside-shape-boxes-003-expected.html: Added.
* fast/shapes/shape-outside-floats/shape-outside-shape-boxes-003.html: Added.
* inspector-protocol/model/highlight-shape-outside.html: Modify shapes to provide their sizing box.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159792 268f45cc-cd09-0410-ab3c-d52691b4dbfc