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

Unified Diff: cc/output/direct_renderer.cc

Issue 669813003: Update from chromium https://crrev.com/301725/ (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « cc/output/direct_renderer.h ('k') | cc/output/gl_renderer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/direct_renderer.cc
diff --git a/cc/output/direct_renderer.cc b/cc/output/direct_renderer.cc
index ad39f1a3ed545eb86df989e8efdc993711c4ecf4..ead2e2129ec011152af449aee2d42b0a705aa003 100644
--- a/cc/output/direct_renderer.cc
+++ b/cc/output/direct_renderer.cc
@@ -82,12 +82,11 @@ void DirectRenderer::InitializeViewport(DrawingFrame* frame,
const gfx::Rect& draw_rect,
const gfx::Rect& viewport_rect,
const gfx::Size& surface_size) {
- bool flip_y = FlippedFramebuffer();
-
DCHECK_GE(viewport_rect.x(), 0);
DCHECK_GE(viewport_rect.y(), 0);
DCHECK_LE(viewport_rect.right(), surface_size.width());
DCHECK_LE(viewport_rect.bottom(), surface_size.height());
+ bool flip_y = FlippedFramebuffer(frame);
if (flip_y) {
frame->projection_matrix = OrthoProjectionMatrix(draw_rect.x(),
draw_rect.right(),
@@ -115,11 +114,12 @@ void DirectRenderer::InitializeViewport(DrawingFrame* frame,
}
gfx::Rect DirectRenderer::MoveFromDrawToWindowSpace(
+ const DrawingFrame* frame,
const gfx::Rect& draw_rect) const {
gfx::Rect window_rect = draw_rect;
window_rect -= current_draw_rect_.OffsetFromOrigin();
window_rect += current_viewport_rect_.OffsetFromOrigin();
- if (FlippedFramebuffer())
+ if (FlippedFramebuffer(frame))
window_rect.set_y(current_surface_size_.height() - window_rect.bottom());
return window_rect;
}
@@ -279,7 +279,7 @@ bool DirectRenderer::NeedDeviceClip(const DrawingFrame* frame) const {
gfx::Rect DirectRenderer::DeviceClipRectInWindowSpace(const DrawingFrame* frame)
const {
gfx::Rect device_clip_rect = frame->device_clip_rect;
- if (FlippedFramebuffer())
+ if (FlippedFramebuffer(frame))
device_clip_rect.set_y(current_surface_size_.height() -
device_clip_rect.bottom());
return device_clip_rect;
@@ -321,7 +321,8 @@ void DirectRenderer::SetScissorStateForQuadWithRenderPassScissor(
void DirectRenderer::SetScissorTestRectInDrawSpace(
const DrawingFrame* frame,
const gfx::Rect& draw_space_rect) {
- gfx::Rect window_space_rect = MoveFromDrawToWindowSpace(draw_space_rect);
+ gfx::Rect window_space_rect =
+ MoveFromDrawToWindowSpace(frame, draw_space_rect);
if (NeedDeviceClip(frame))
window_space_rect.Intersect(DeviceClipRectInWindowSpace(frame));
SetScissorTestRect(window_space_rect);
« no previous file with comments | « cc/output/direct_renderer.h ('k') | cc/output/gl_renderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698