GraphicsContext3DCG needs to copy image data in paintToCanvas
https://bugs.webkit.org/show_bug.cgi?id=108310

Reviewed by Simon Fraser.

Make the CG implementation of GraphicsContext3D::paintToCanvas copy image data
before drawing if we're drawing into an accelerated context, matching the fix made
in http://trac.webkit.org/changeset/106095 for 2D canvas.

No new tests, depends on acceleration and would be flaky at best.

* platform/graphics/GraphicsContext3D.h:
(GraphicsContext3D): Make CG's paintToCanvas take a GraphicsContext instead of a CGContextRef.
* platform/graphics/cg/GraphicsContext3DCG.cpp:
(WebCore::releaseImageData): Added.
(WebCore::GraphicsContext3D::paintToCanvas): Copy image data if the destination is
an accelerated context. Also, use GraphicsContext API instead of CGContext.
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::paintRenderingResultsToCanvas):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141288 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(r136324): Flexbox should relayout flex children when width changes
https://bugs.webkit.org/show_bug.cgi?id=108231

Reviewed by Ojan Vafai.

Source/WebCore:

If the width of a block changes, we need to set relayoutChildren = true
to relayout the children. This broke when we optimized the layout calls
in layoutAndPlaceChildren.

Test: css3/flexbox/width-change-and-relayout-children.html

* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::layoutBlock): Also reorder the code to match RenderBlock.
The bug fix is to use updateLogicalWidthAndColumnWidth() and its return value to set
relayoutChildren = true.

LayoutTests:

* css3/flexbox/width-change-and-relayout-children-expected.txt: Added.
* css3/flexbox/width-change-and-relayout-children.html: Added.


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