Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(366)

Unified Diff: cc/output/direct_renderer.cc

Issue 15579002: Implement transform/clip support for Android WebView. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add GL support and clean up Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;
}

Powered by Google App Engine
This is Rietveld 408576698