diff options
author | piman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-22 20:47:20 +0000 |
---|---|---|
committer | piman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-22 20:47:20 +0000 |
commit | 734e8252e179fde6a497ab873c436df82780695a (patch) | |
tree | f13f112d4a98ad74c910b68c82fa2180d2e38261 /ui/compositor | |
parent | 7389f65ef31647d78977ee9e58245f85a22a3724 (diff) | |
download | chromium_src-734e8252e179fde6a497ab873c436df82780695a.zip chromium_src-734e8252e179fde6a497ab873c436df82780695a.tar.gz chromium_src-734e8252e179fde6a497ab873c436df82780695a.tar.bz2 |
Merge 162830 - Aura: Remove scale_content_ handling for accelerated content
Changing scale_content_ while we are painting causes a lot of trouble.
r158099 made it that we have a good way to adapt DSF mismatch for accelerated
content, so we don't need to consider scale_content_ there any more.
In a follow up, we can remove scale_content_ altogether, since it's always true.
BUG=156156
Review URL: https://chromiumcodereview.appspot.com/11198056
TBR=piman@chromium.org
Review URL: https://codereview.chromium.org/11227037
git-svn-id: svn://svn.chromium.org/chrome/branches/1271/src@163374 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/compositor')
-rw-r--r-- | ui/compositor/layer.cc | 16 | ||||
-rw-r--r-- | ui/compositor/layer.h | 7 |
2 files changed, 8 insertions, 15 deletions
diff --git a/ui/compositor/layer.cc b/ui/compositor/layer.cc index 71daa33..e18d244 100644 --- a/ui/compositor/layer.cc +++ b/ui/compositor/layer.cc @@ -460,11 +460,6 @@ void Layer::SendDamagedRects() { sk_damaged.width(), sk_damaged.height()); - if (scale_content_ && web_layer_is_accelerated_) { - damaged.Inset(-1, -1); - damaged = damaged.Intersect(gfx::Rect(bounds_.size())); - } - gfx::Rect damaged_in_pixel = ConvertRectToPixel(this, damaged); WebKit::WebFloatRect web_rect( damaged_in_pixel.x(), @@ -507,7 +502,8 @@ void Layer::paintContents(WebKit::WebCanvas* web_canvas, scoped_ptr<gfx::Canvas> canvas(gfx::Canvas::CreateCanvasWithoutScaling( web_canvas, ui::GetScaleFactorFromScale(device_scale_factor_))); - if (scale_content_) { + bool scale_content = scale_content_; + if (scale_content) { canvas->Save(); canvas->sk_canvas()->scale(SkFloatToScalar(device_scale_factor_), SkFloatToScalar(device_scale_factor_)); @@ -515,7 +511,7 @@ void Layer::paintContents(WebKit::WebCanvas* web_canvas, if (delegate_) delegate_->OnPaintLayer(canvas.get()); - if (scale_content_) + if (scale_content) canvas->Restore(); } @@ -750,11 +746,7 @@ void Layer::RecomputeDrawsContentAndUVRect() { } else { DCHECK(texture_); - gfx::Size texture_size; - if (scale_content_) - texture_size = texture_->size(); - else - texture_size = ConvertSizeToDIP(this, texture_->size()); + gfx::Size texture_size = ConvertSizeToDIP(this, texture_->size()); gfx::Size size(std::min(bounds().width(), texture_size.width()), std::min(bounds().height(), texture_size.height())); diff --git a/ui/compositor/layer.h b/ui/compositor/layer.h index f9fcbc9..b698159 100644 --- a/ui/compositor/layer.h +++ b/ui/compositor/layer.h @@ -247,9 +247,10 @@ class COMPOSITOR_EXPORT Layer // Sets whether the layer should scale its content. If true, the canvas will // be scaled in software rendering mode before it is passed to - // |LayerDelegate::OnPaint| and the texture will be scaled in accelerated - // mode. Set to false if the delegate handles scaling and the texture is - // the correct pixel size. + // |LayerDelegate::OnPaint|. + // Set to false if the delegate handles scaling. + // NOTE: if this is called during |LayerDelegate::OnPaint|, the new value will + // not apply to the canvas passed to the pending draw. void set_scale_content(bool scale_content) { scale_content_ = scale_content; } // Returns true if the layer scales its content. |