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

Unified Diff: ui/compositor/layer.cc

Issue 10332077: Zoom the web contents 2x such that they are blurry in High DPI (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nicer diff Created 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/layer.cc
diff --git a/ui/compositor/layer.cc b/ui/compositor/layer.cc
index be6c577f5b727c00e98b7c388d770d328b762ffb..ffcce6d19d88551d36dd66396856206212901542 100644
--- a/ui/compositor/layer.cc
+++ b/ui/compositor/layer.cc
@@ -309,12 +309,20 @@ void Layer::SetColor(SkColor color) {
bool Layer::SchedulePaint(const gfx::Rect& invalid_rect) {
if (type_ == LAYER_SOLID_COLOR || !delegate_)
return false;
- gfx::Rect invalid_rect_in_pixel = ConvertRectToPixel(this, invalid_rect);
- damaged_region_.op(invalid_rect_in_pixel.x(),
- invalid_rect_in_pixel.y(),
- invalid_rect_in_pixel.right(),
- invalid_rect_in_pixel.bottom(),
- SkRegion::kUnion_Op);
+ if (web_layer_is_accelerated_) {
oshima 2012/05/09 21:11:58 DCHECK(texture_); Please add comment + TODO
+ damaged_region_.op(invalid_rect.x(),
+ invalid_rect.y(),
+ invalid_rect.right(),
+ invalid_rect.bottom(),
+ SkRegion::kUnion_Op);
+ } else {
+ gfx::Rect invalid_rect_in_pixel = ConvertRectToPixel(this, invalid_rect);
+ damaged_region_.op(invalid_rect_in_pixel.x(),
+ invalid_rect_in_pixel.y(),
+ invalid_rect_in_pixel.right(),
+ invalid_rect_in_pixel.bottom(),
+ SkRegion::kUnion_Op);
+ }
ScheduleDraw();
return true;
}
@@ -556,6 +564,10 @@ void Layer::RecomputeTransform() {
0, 0, 1);
transform.ConcatTransform(transform_);
transform.ConcatTranslate(bounds_.x(), bounds_.y());
+
+ if (texture_)
+ transform.ConcatScale(device_scale_factor_, device_scale_factor_);
+
transform.ConcatTransform(scale_translate);
web_layer_.setTransform(transform.matrix());
} else {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698