Index: cc/output/direct_renderer.cc |
diff --git a/cc/output/direct_renderer.cc b/cc/output/direct_renderer.cc |
index 429ac22bc5de82624461d1bdff5fc5e7949a4369..67aad836768c4709aa35215c7cad02ba7c0bef9a 100644 |
--- a/cc/output/direct_renderer.cc |
+++ b/cc/output/direct_renderer.cc |
@@ -80,6 +80,7 @@ void DirectRenderer::QuadRectTransform(gfx::Transform* quad_rect_transform, |
// static |
void DirectRenderer::InitializeMatrices(DrawingFrame* frame, |
+ gfx::Vector2d offset, |
gfx::Rect draw_rect, |
bool flip_y) { |
if (flip_y) { |
@@ -93,12 +94,12 @@ void DirectRenderer::InitializeMatrices(DrawingFrame* frame, |
draw_rect.y(), |
draw_rect.bottom()); |
} |
- frame->window_matrix = |
- window_matrix(0, 0, draw_rect.width(), draw_rect.height()); |
+ |
+ frame->window_matrix = window_matrix( |
+ offset.x(), offset.y(), draw_rect.width(), draw_rect.height()); |
frame->flipped_y = flip_y; |
} |
-// static |
gfx::Rect DirectRenderer::MoveScissorToWindowSpace( |
const DrawingFrame* frame, const gfx::RectF& scissor_rect) { |
gfx::Rect scissor_rect_in_canvas_space = gfx::ToEnclosingRect(scissor_rect); |
@@ -116,6 +117,8 @@ gfx::Rect DirectRenderer::MoveScissorToWindowSpace( |
scissor_rect_in_canvas_space.set_y( |
scissor_rect_in_canvas_space.y() - framebuffer_output_rect.y()); |
} |
+ if (!frame->current_texture) |
+ scissor_rect_in_canvas_space.Offset(client_->DeviceViewportOffset()); |
return scissor_rect_in_canvas_space; |
} |
@@ -323,7 +326,10 @@ bool DirectRenderer::UseRenderPass(DrawingFrame* frame, |
if (render_pass == frame->root_render_pass) { |
BindFramebufferToOutputSurface(frame); |
- InitializeMatrices(frame, render_pass->output_rect, FlippedFramebuffer()); |
+ InitializeMatrices(frame, |
+ client_->DeviceViewportOffset(), |
+ render_pass->output_rect, |
+ FlippedFramebuffer()); |
SetDrawViewportSize(render_pass->output_rect.size()); |
return true; |
} |