[Texmap] Consolidate redundant code for ARB_RECT texture
https://bugs.webkit.org/show_bug.cgi?id=104705

Patch by No'am Rosenthal <noam@webkit.org> on 2012-12-12
Reviewed by Kenneth Rohde Christiansen.

Instead of having a whole different function for RECT textures,
keep the existing functions and pass a flag that tells
TextureMapperGL to use the non-normalized coordinates and the
RECT shaders.

No new tests, refactor only. Tested to not break WebGL on
Qt-Mac.

* platform/graphics/surfaces/mac/GraphicsSurfaceMac.cpp:
* platform/graphics/surfaces/glx/GraphicsSurfaceGLX.cpp:
(WebCore::GraphicsSurface::platformPaintToTextureMapper):
* platform/graphics/texmap/TextureMapperGL.cpp:
(WebCore::TextureMapperGL::drawQuad):
    Compensate for rect textures in drawQuad.

(WebCore::TextureMapperGL::drawBorder):
(WebCore::TextureMapperGL::drawTexture):
(WebCore::TextureMapperGL::drawSolidColor):
(WebCore::TextureMapperGL::drawTextureWithAntialiasing):
(WebCore::TextureMapperGL::drawTexturedQuadWithProgram):
    Pass flags to TextureMapperGL::drawQuad instead of a bool.

* platform/graphics/texmap/TextureMapperGL.h:
(TextureMapperGL):
* platform/graphics/texmap/TextureMapperShaderManager.cpp:
(WebCore::getShaderSpec):
* platform/graphics/texmap/TextureMapperShaderManager.h:
(TextureMapperShaderProgram):
    Compensate for the texture-size in the vertex
    shader instead of in the fragment shader.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@137498 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Mark the template inert contents test as flaky on cr-win as well.

Unreviewed.

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@137499 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Use CAFilter rather than CIFilter
https://bugs.webkit.org/show_bug.cgi?id=104759

Reviewed by Tim Horton.

Source/WebCore:

In order to get better performance in the simple CSS filter
cases, use CAFilter rather than CIFilter. This involved
defining some platform-specific values inside
PlatformCALayerMac to expose CAFilter.

The great side-effect is that this brings our hardware
output much closer to our software filters. For example,
on a random location in the hue-rotate test.

Software: rgb(255, 148, 16)
Hardware before: rgb(255, 204, 50)
Hardware after: rgb(255, 165, 33)

Still some improvement needed, but better.

Covered by existing tests.

* platform/graphics/ca/mac/PlatformCALayerMac.mm:
(CAColorMatrix): New structure to hold 5x4 matrix representing a color operation.
(PlatformCALayer::setFilters): Use CAFilter objects rather than CIFilter.

LayoutTests:

Update the expected results. They are now much closer to the software case (on Mac).

* css3/filters/composited-reflected-expected.png:
* css3/filters/effect-blur-hw-expected.png:
* css3/filters/effect-brightness-hw-expected.png:
* css3/filters/effect-combined-hw-expected.png:
* css3/filters/effect-contrast-hw-expected.png:
* css3/filters/effect-drop-shadow-hw-expected.png:
* css3/filters/effect-grayscale-hw-expected.png:
* css3/filters/effect-hue-rotate-hw-expected.png:
* css3/filters/effect-invert-hw-expected.png:
* css3/filters/effect-opacity-hw-expected.png:
* css3/filters/effect-saturate-hw-expected.png:
* css3/filters/effect-sepia-hw-expected.png:

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