Index: cc/direct_renderer.cc |
diff --git a/cc/direct_renderer.cc b/cc/direct_renderer.cc |
index 7e2e31e70b273fe1f144474ba4eaeb66d7af84a8..d54b17579be3c338dbbe61c269dc9acf726f66bd 100644 |
--- a/cc/direct_renderer.cc |
+++ b/cc/direct_renderer.cc |
@@ -9,42 +9,42 @@ |
#include "base/debug/trace_event.h" |
#include "cc/math_util.h" |
#include "ui/gfx/rect_conversions.h" |
-#include <public/WebTransformationMatrix.h> |
+#include "ui/gfx/transform.h" |
-using WebKit::WebTransformationMatrix; |
+using gfx::Transform; |
-static WebTransformationMatrix orthoProjectionMatrix(float left, float right, float bottom, float top) |
+static Transform orthoProjectionMatrix(float left, float right, float bottom, float top) |
{ |
// Use the standard formula to map the clipping frustum to the cube from |
// [-1, -1, -1] to [1, 1, 1]. |
float deltaX = right - left; |
float deltaY = top - bottom; |
- WebTransformationMatrix proj; |
+ Transform proj; |
if (!deltaX || !deltaY) |
return proj; |
- proj.setM11(2.0f / deltaX); |
- proj.setM41(-(right + left) / deltaX); |
- proj.setM22(2.0f / deltaY); |
- proj.setM42(-(top + bottom) / deltaY); |
+ proj.matrix().setDouble(0, 0, 2.0f / deltaX); |
+ proj.matrix().setDouble(0, 3, -(right + left) / deltaX); |
+ proj.matrix().setDouble(1, 1, 2.0f / deltaY); |
+ proj.matrix().setDouble(1, 3, -(top + bottom) / deltaY); |
// Z component of vertices is always set to zero as we don't use the depth buffer |
// while drawing. |
- proj.setM33(0); |
+ proj.matrix().setDouble(2, 2, 0); |
return proj; |
} |
-static WebTransformationMatrix windowMatrix(int x, int y, int width, int height) |
+static Transform windowMatrix(int x, int y, int width, int height) |
{ |
- WebTransformationMatrix canvas; |
+ Transform canvas; |
// Map to window position and scale up to pixel coordinates. |
- canvas.translate3d(x, y, 0); |
- canvas.scale3d(width, height, 0); |
+ canvas.PreconcatTranslate3d(x, y, 0); |
+ canvas.PreconcatScale3d(width, height, 0); |
// Map from ([-1, -1] to [1, 1]) -> ([0, 0] to [1, 1]) |
- canvas.translate3d(0.5, 0.5, 0.5); |
- canvas.scale3d(0.5, 0.5, 0.5); |
+ canvas.PreconcatTranslate3d(0.5, 0.5, 0.5); |
+ canvas.PreconcatScale3d(0.5, 0.5, 0.5); |
return canvas; |
} |
@@ -71,11 +71,11 @@ gfx::RectF DirectRenderer::quadVertexRect() |
} |
// static |
-void DirectRenderer::quadRectTransform(WebKit::WebTransformationMatrix* quadRectTransform, const WebKit::WebTransformationMatrix& quadTransform, const gfx::RectF& quadRect) |
+void DirectRenderer::quadRectTransform(gfx::Transform* quadRectTransform, const gfx::Transform& quadTransform, const gfx::RectF& quadRect) |
{ |
*quadRectTransform = quadTransform; |
- quadRectTransform->translate(0.5 * quadRect.width() + quadRect.x(), 0.5 * quadRect.height() + quadRect.y()); |
- quadRectTransform->scaleNonUniform(quadRect.width(), quadRect.height()); |
+ quadRectTransform->PreconcatTranslate(0.5 * quadRect.width() + quadRect.x(), 0.5 * quadRect.height() + quadRect.y()); |
+ quadRectTransform->PreconcatScale(quadRect.width(), quadRect.height()); |
} |
// static |
@@ -177,7 +177,7 @@ void DirectRenderer::drawRenderPass(DrawingFrame& frame, const RenderPass* rende |
frame.scissorRectInRenderPassSpace = frame.currentRenderPass->output_rect; |
if (frame.rootDamageRect != frame.rootRenderPass->output_rect) { |
- WebTransformationMatrix inverseTransformToRoot = frame.currentRenderPass->transform_to_root_target.inverse(); |
+ Transform inverseTransformToRoot = MathUtil::inverse(frame.currentRenderPass->transform_to_root_target); |
gfx::RectF damageRectInRenderPassSpace = MathUtil::projectClippedRect(inverseTransformToRoot, frame.rootDamageRect); |
frame.scissorRectInRenderPassSpace.Intersect(damageRectInRenderPassSpace); |
} |