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

Side by Side Diff: cc/render_surface_impl.cc

Issue 11276060: Pass accurate contentsScale to LayerImpl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 8 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/layer_unittest.cc ('k') | cc/scrollbar_layer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 6
7 #include "cc/render_surface_impl.h" 7 #include "cc/render_surface_impl.h"
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/stringprintf.h" 10 #include "base/stringprintf.h"
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 maskLayer = m_owningLayer->replicaLayer()->maskLayer(); 229 maskLayer = m_owningLayer->replicaLayer()->maskLayer();
230 if (maskLayer && (!maskLayer->drawsContent() || maskLayer->bounds().isEm pty())) 230 if (maskLayer && (!maskLayer->drawsContent() || maskLayer->bounds().isEm pty()))
231 maskLayer = 0; 231 maskLayer = 0;
232 } 232 }
233 233
234 float maskTexCoordScaleX = 1; 234 float maskTexCoordScaleX = 1;
235 float maskTexCoordScaleY = 1; 235 float maskTexCoordScaleY = 1;
236 float maskTexCoordOffsetX = 0; 236 float maskTexCoordOffsetX = 0;
237 float maskTexCoordOffsetY = 0; 237 float maskTexCoordOffsetY = 0;
238 if (maskLayer) { 238 if (maskLayer) {
239 maskTexCoordScaleX = static_cast<float>(contentRect().width()) / maskLay er->contentBounds().width(); 239 maskTexCoordScaleX = contentRect().width() / maskLayer->contentsScaleX() / maskLayer->bounds().width();
240 maskTexCoordScaleY = static_cast<float>(contentRect().height()) / maskLa yer->contentBounds().height(); 240 maskTexCoordScaleY = contentRect().height() / maskLayer->contentsScaleY( ) / maskLayer->bounds().height();
241 maskTexCoordOffsetX = static_cast<float>(contentRect().x()) / contentRec t().width() * maskTexCoordScaleX; 241 maskTexCoordOffsetX = static_cast<float>(contentRect().x()) / contentRec t().width() * maskTexCoordScaleX;
242 maskTexCoordOffsetY = static_cast<float>(contentRect().y()) / contentRec t().height() * maskTexCoordScaleY; 242 maskTexCoordOffsetY = static_cast<float>(contentRect().y()) / contentRec t().height() * maskTexCoordScaleY;
243 } 243 }
244 244
245 ResourceProvider::ResourceId maskResourceId = maskLayer ? maskLayer->content sResourceId() : 0; 245 ResourceProvider::ResourceId maskResourceId = maskLayer ? maskLayer->content sResourceId() : 0;
246 IntRect contentsChangedSinceLastFrame = contentsChanged() ? m_contentRect : IntRect(); 246 IntRect contentsChangedSinceLastFrame = contentsChanged() ? m_contentRect : IntRect();
247 247
248 quadSink.append(RenderPassDrawQuad::create(sharedQuadState, contentRect(), r enderPassId, forReplica, maskResourceId, contentsChangedSinceLastFrame, 248 quadSink.append(RenderPassDrawQuad::create(sharedQuadState, contentRect(), r enderPassId, forReplica, maskResourceId, contentsChangedSinceLastFrame,
249 maskTexCoordScaleX, maskTexCoor dScaleY, maskTexCoordOffsetX, maskTexCoordOffsetY).PassAs<DrawQuad>(), appendQua dsData); 249 maskTexCoordScaleX, maskTexCoor dScaleY, maskTexCoordOffsetX, maskTexCoordOffsetY).PassAs<DrawQuad>(), appendQua dsData);
250 } 250 }
251 251
252 } 252 }
OLDNEW
« no previous file with comments | « cc/layer_unittest.cc ('k') | cc/scrollbar_layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698