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

Unified Diff: cc/layers/solid_color_layer_impl.cc

Issue 681713002: Update from chromium https://crrev.com/301315 (Closed) Base URL: https://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/layers/solid_color_layer_impl.h ('k') | cc/quads/render_pass.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/solid_color_layer_impl.cc
diff --git a/cc/layers/solid_color_layer_impl.cc b/cc/layers/solid_color_layer_impl.cc
index c8ddc7d7df85e2b820a714b47084fe7cd24d428a..e7ba09f1acfd6190bd310d557e7f3cbfa7f2efab 100644
--- a/cc/layers/solid_color_layer_impl.cc
+++ b/cc/layers/solid_color_layer_impl.cc
@@ -31,15 +31,17 @@ void SolidColorLayerImpl::AppendSolidQuads(
RenderPass* render_pass,
const Occlusion& occlusion_in_content_space,
SharedQuadState* shared_quad_state,
- const gfx::Size& content_bounds,
+ const gfx::Rect& visible_content_rect,
SkColor color,
AppendQuadsData* append_quads_data) {
// We create a series of smaller quads instead of just one large one so that
// the culler can reduce the total pixels drawn.
- int width = content_bounds.width();
- int height = content_bounds.height();
- for (int x = 0; x < width; x += kSolidQuadTileSize) {
- for (int y = 0; y < height; y += kSolidQuadTileSize) {
+ int width = visible_content_rect.width();
+ int height = visible_content_rect.height();
+ for (int x = visible_content_rect.x(); x < visible_content_rect.right();
+ x += kSolidQuadTileSize) {
+ for (int y = visible_content_rect.y(); y < visible_content_rect.bottom();
+ y += kSolidQuadTileSize) {
gfx::Rect quad_rect(x,
y,
std::min(width - x, kSolidQuadTileSize),
@@ -71,10 +73,12 @@ void SolidColorLayerImpl::AppendQuads(
AppendDebugBorderQuad(
render_pass, content_bounds(), shared_quad_state, append_quads_data);
+ // TODO(hendrikw): We need to pass the visible content rect rather than
+ // |content_bounds()| here.
AppendSolidQuads(render_pass,
occlusion_in_content_space,
shared_quad_state,
- content_bounds(),
+ gfx::Rect(content_bounds()),
background_color(),
append_quads_data);
}
« no previous file with comments | « cc/layers/solid_color_layer_impl.h ('k') | cc/quads/render_pass.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698