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

Unified Diff: cc/output/gl_renderer.cc

Issue 973223002: cc: Scale checkerboard quads by the device scale factor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: checkerboardscale: fixwindowsbuild Created 5 years, 10 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/tiled_layer_impl.cc ('k') | cc/output/overlay_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/gl_renderer.cc
diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc
index 6142d96408d22e51d47489f905c1280e62ffa635..45664771b5755c45d571d83fb0f82755be7416d7 100644
--- a/cc/output/gl_renderer.cc
+++ b/cc/output/gl_renderer.cc
@@ -559,14 +559,16 @@ void GLRenderer::DrawCheckerboardQuad(const DrawingFrame* frame,
SkColorGetB(color) * (1.0f / 255.0f),
1));
- const int checkerboard_width = 16;
- float frequency = 1.0f / checkerboard_width;
+ const int kCheckerboardWidth = 16;
+ float frequency = 1.0f / kCheckerboardWidth;
gfx::Rect tile_rect = quad->rect;
- float tex_offset_x = tile_rect.x() % checkerboard_width;
- float tex_offset_y = tile_rect.y() % checkerboard_width;
- float tex_scale_x = tile_rect.width();
- float tex_scale_y = tile_rect.height();
+ float tex_offset_x =
+ static_cast<int>(tile_rect.x() / quad->scale) % kCheckerboardWidth;
+ float tex_offset_y =
+ static_cast<int>(tile_rect.y() / quad->scale) % kCheckerboardWidth;
+ float tex_scale_x = tile_rect.width() / quad->scale;
+ float tex_scale_y = tile_rect.height() / quad->scale;
GLC(gl_,
gl_->Uniform4f(program->fragment_shader().tex_transform_location(),
tex_offset_x,
« no previous file with comments | « cc/layers/tiled_layer_impl.cc ('k') | cc/output/overlay_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698