OLD | NEW |
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 Loading... |
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 } |
OLD | NEW |