summaryrefslogtreecommitdiffstats
path: root/cc/output/direct_renderer.h
diff options
context:
space:
mode:
authordanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-07 18:12:18 +0000
committerdanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-07 18:12:18 +0000
commitb4ead7bdfe512cee69862f8b79200b88d41d7317 (patch)
tree0d30671c758e273fcd79c9c52d68cf567411f389 /cc/output/direct_renderer.h
parent2056c3b91cd582ef0d4281f19d1e35215a4732ab (diff)
downloadchromium_src-b4ead7bdfe512cee69862f8b79200b88d41d7317.zip
chromium_src-b4ead7bdfe512cee69862f8b79200b88d41d7317.tar.gz
chromium_src-b4ead7bdfe512cee69862f8b79200b88d41d7317.tar.bz2
cc: Change damage tracking from floats to integers.
Damage rects can become huge when layers clip the viewport, and in some cases become so large that we reach inaccurate floating point representation of the whole-number portion, which we fail to handle correctly when doing gfx::ToEnclosingRect. Int/float conversions are also slow, and the GL_SCISSOR wants integers eventually anyway, so keeping track of partial-pixel damage is not buying us much here. So convert the DamageTracker to use integer rects. Also change cc::RenderSurfaceImpl to export a damage_rect that is contained inside the output_rect for the RenderPass, and add DCHECKs to cc::RenderPass to ensure we don't send pointlessly large damage_rects to the cc::Renderer. Tests: DamageTrackerTest.HugeDamageRect R=enne@chromium.org, piman@chromium.org BUG=355514 Review URL: https://codereview.chromium.org/226183007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@262160 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/output/direct_renderer.h')
-rw-r--r--cc/output/direct_renderer.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/cc/output/direct_renderer.h b/cc/output/direct_renderer.h
index fce36db..a1eacad 100644
--- a/cc/output/direct_renderer.h
+++ b/cc/output/direct_renderer.h
@@ -48,7 +48,7 @@ class CC_EXPORT DirectRenderer : public Renderer {
const RenderPass* current_render_pass;
const ScopedResource* current_texture;
- gfx::RectF root_damage_rect;
+ gfx::Rect root_damage_rect;
gfx::Rect device_viewport_rect;
gfx::Rect device_clip_rect;
@@ -78,19 +78,19 @@ class CC_EXPORT DirectRenderer : public Renderer {
const gfx::Rect& draw_rect,
const gfx::Rect& viewport_rect,
const gfx::Size& surface_size);
- gfx::Rect MoveFromDrawToWindowSpace(const gfx::RectF& draw_rect) const;
+ gfx::Rect MoveFromDrawToWindowSpace(const gfx::Rect& draw_rect) const;
bool NeedDeviceClip(const DrawingFrame* frame) const;
gfx::Rect DeviceClipRectInWindowSpace(const DrawingFrame* frame) const;
- static gfx::RectF ComputeScissorRectForRenderPass(const DrawingFrame* frame);
+ static gfx::Rect ComputeScissorRectForRenderPass(const DrawingFrame* frame);
void SetScissorStateForQuad(const DrawingFrame* frame, const DrawQuad& quad);
void SetScissorStateForQuadWithRenderPassScissor(
const DrawingFrame* frame,
const DrawQuad& quad,
- const gfx::RectF& render_pass_scissor,
+ const gfx::Rect& render_pass_scissor,
bool* should_skip_quad);
void SetScissorTestRectInDrawSpace(const DrawingFrame* frame,
- const gfx::RectF& draw_space_rect);
+ const gfx::Rect& draw_space_rect);
static gfx::Size RenderPassTextureSize(const RenderPass* render_pass);