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

Unified Diff: ui/compositor/layer.cc

Issue 10383297: Revert 138415 - Makes the browser send pixels to the GPU process where it should. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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 | « ui/compositor/layer.h ('k') | webkit/glue/webpreferences.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/layer.cc
===================================================================
--- ui/compositor/layer.cc (revision 138418)
+++ ui/compositor/layer.cc (working copy)
@@ -53,7 +53,7 @@
layer_updated_externally_(false),
opacity_(1.0f),
delegate_(NULL),
- scale_content_(true),
+ scale_canvas_(true),
device_scale_factor_(1.0f) {
CreateWebLayer();
}
@@ -67,7 +67,7 @@
layer_updated_externally_(false),
opacity_(1.0f),
delegate_(NULL),
- scale_content_(true),
+ scale_canvas_(true),
device_scale_factor_(1.0f) {
CreateWebLayer();
}
@@ -340,7 +340,9 @@
sk_damaged.width(),
sk_damaged.height());
- if (scale_content_ && web_layer_is_accelerated_) {
+ // TODO(pkotwicz): Remove this once we are no longer linearly upscaling
+ // web contents when DIP is enabled (crbug.com/127455).
+ if (web_layer_is_accelerated_) {
damaged.Inset(-1, -1);
damaged = damaged.Intersect(bounds_);
}
@@ -388,14 +390,14 @@
const WebKit::WebRect& clip) {
TRACE_EVENT0("ui", "Layer::paintContents");
gfx::Canvas canvas(web_canvas);
- bool scale_content = scale_content_;
- if (scale_content) {
+ bool scale_canvas = scale_canvas_;
+ if (scale_canvas) {
canvas.sk_canvas()->scale(SkFloatToScalar(device_scale_factor_),
SkFloatToScalar(device_scale_factor_));
}
if (delegate_)
delegate_->OnPaintLayer(&canvas);
- if (scale_content)
+ if (scale_canvas)
canvas.Restore();
}
@@ -589,13 +591,13 @@
WebKit::WebExternalTextureLayer texture_layer =
web_layer_.to<WebKit::WebExternalTextureLayer>();
texture_layer.setTextureId(should_draw ? texture_id : 0);
+ gfx::Size texture_size = texture_->size();
- gfx::Size texture_size;
- if (scale_content_)
- texture_size = texture_->size();
- else
- texture_size = ConvertSizeToDIP(this, texture_->size());
-
+ // As WebKit does not support DIP, WebKit is told of coordinates in DIP
+ // as if they were pixel coordinates. The texture is scaled here via
+ // the setBounds call.
+ // TODO(pkotwicz): Fix this code to take in account textures with pixel
+ // sizes once WebKit understands DIP. http://crbug.com/127455
gfx::Size size(std::min(bounds().width(), texture_size.width()),
std::min(bounds().height(), texture_size.height()));
WebKit::WebFloatRect rect(
« no previous file with comments | « ui/compositor/layer.h ('k') | webkit/glue/webpreferences.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698