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 #if USE(ACCELERATED_COMPOSITING) | 7 #if USE(ACCELERATED_COMPOSITING) |
8 | 8 |
9 #include "CCRenderSurface.h" | 9 #include "CCRenderSurface.h" |
10 | 10 |
11 #include "CCDamageTracker.h" | 11 #include "CCDamageTracker.h" |
12 #include "CCDebugBorderDrawQuad.h" | 12 #include "CCDebugBorderDrawQuad.h" |
13 #include "CCLayerImpl.h" | 13 #include "CCLayerImpl.h" |
14 #include "CCMathUtil.h" | 14 #include "CCMathUtil.h" |
15 #include "CCQuadSink.h" | 15 #include "CCQuadSink.h" |
| 16 #include "CCRenderPass.h" |
16 #include "CCRenderPassDrawQuad.h" | 17 #include "CCRenderPassDrawQuad.h" |
| 18 #include "CCRenderPassSink.h" |
17 #include "CCSharedQuadState.h" | 19 #include "CCSharedQuadState.h" |
18 #include "TextStream.h" | 20 #include "TextStream.h" |
19 #include <public/WebTransformationMatrix.h> | 21 #include <public/WebTransformationMatrix.h> |
20 #include <wtf/text/CString.h> | 22 #include <wtf/text/CString.h> |
21 | 23 |
22 using WebKit::WebTransformationMatrix; | 24 using WebKit::WebTransformationMatrix; |
23 | 25 |
24 namespace WebCore { | 26 namespace WebCore { |
25 | 27 |
26 static const int debugSurfaceBorderWidth = 2; | 28 static const int debugSurfaceBorderWidth = 2; |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 // FIXME: this should be able to be a tighter scissor, perhaps expanded
by the filter outsets? | 153 // FIXME: this should be able to be a tighter scissor, perhaps expanded
by the filter outsets? |
152 clippedRectInTarget = renderTarget->renderSurface()->contentRect(); | 154 clippedRectInTarget = renderTarget->renderSurface()->contentRect(); |
153 } else if (clippedRectInTarget.isEmpty()) { | 155 } else if (clippedRectInTarget.isEmpty()) { |
154 // For surfaces, empty clipRect means that the surface does not clip any
thing. | 156 // For surfaces, empty clipRect means that the surface does not clip any
thing. |
155 clippedRectInTarget = enclosingIntRect(intersection(renderTarget->render
Surface()->contentRect(), self->drawableContentRect())); | 157 clippedRectInTarget = enclosingIntRect(intersection(renderTarget->render
Surface()->contentRect(), self->drawableContentRect())); |
156 } else | 158 } else |
157 clippedRectInTarget.intersect(enclosingIntRect(self->drawableContentRect
())); | 159 clippedRectInTarget.intersect(enclosingIntRect(self->drawableContentRect
())); |
158 return clippedRectInTarget; | 160 return clippedRectInTarget; |
159 } | 161 } |
160 | 162 |
| 163 void CCRenderSurface::appendRenderPasses(CCRenderPassSink& passSink) |
| 164 { |
| 165 OwnPtr<CCRenderPass> pass = CCRenderPass::create(m_owningLayer->id(), m_cont
entRect, m_screenSpaceTransform); |
| 166 pass->setDamageRect(m_damageTracker->currentDamageRect()); |
| 167 pass->setFilters(m_owningLayer->filters()); |
| 168 pass->setBackgroundFilters(m_owningLayer->backgroundFilters()); |
| 169 passSink.appendRenderPass(pass.release()); |
| 170 } |
| 171 |
161 void CCRenderSurface::appendQuads(CCQuadSink& quadSink, bool forReplica, int ren
derPassId) | 172 void CCRenderSurface::appendQuads(CCQuadSink& quadSink, bool forReplica, int ren
derPassId) |
162 { | 173 { |
163 ASSERT(!forReplica || m_owningLayer->hasReplica()); | 174 ASSERT(!forReplica || m_owningLayer->hasReplica()); |
164 | 175 |
165 IntRect clippedRectInTarget = computeClippedRectInTarget(m_owningLayer); | 176 IntRect clippedRectInTarget = computeClippedRectInTarget(m_owningLayer); |
166 bool isOpaque = false; | 177 bool isOpaque = false; |
167 const WebTransformationMatrix& drawTransform = forReplica ? m_replicaDrawTra
nsform : m_drawTransform; | 178 const WebTransformationMatrix& drawTransform = forReplica ? m_replicaDrawTra
nsform : m_drawTransform; |
168 CCSharedQuadState* sharedQuadState = quadSink.useSharedQuadState(CCSharedQua
dState::create(drawTransform, m_contentRect, clippedRectInTarget, m_drawOpacity,
isOpaque)); | 179 CCSharedQuadState* sharedQuadState = quadSink.useSharedQuadState(CCSharedQua
dState::create(drawTransform, m_contentRect, clippedRectInTarget, m_drawOpacity,
isOpaque)); |
169 | 180 |
170 if (m_owningLayer->hasDebugBorders()) { | 181 if (m_owningLayer->hasDebugBorders()) { |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 | 215 |
205 CCResourceProvider::ResourceId maskResourceId = maskLayer ? maskLayer->conte
ntsResourceId() : 0; | 216 CCResourceProvider::ResourceId maskResourceId = maskLayer ? maskLayer->conte
ntsResourceId() : 0; |
206 IntRect contentsChangedSinceLastFrame = contentsChanged() ? m_contentRect :
IntRect(); | 217 IntRect contentsChangedSinceLastFrame = contentsChanged() ? m_contentRect :
IntRect(); |
207 | 218 |
208 quadSink.append(CCRenderPassDrawQuad::create(sharedQuadState, contentRect(),
renderPassId, forReplica, maskResourceId, contentsChangedSinceLastFrame, | 219 quadSink.append(CCRenderPassDrawQuad::create(sharedQuadState, contentRect(),
renderPassId, forReplica, maskResourceId, contentsChangedSinceLastFrame, |
209 maskTexCoordScaleX, maskTexCoor
dScaleY, maskTexCoordOffsetX, maskTexCoordOffsetY)); | 220 maskTexCoordScaleX, maskTexCoor
dScaleY, maskTexCoordOffsetX, maskTexCoordOffsetY)); |
210 } | 221 } |
211 | 222 |
212 } | 223 } |
213 #endif // USE(ACCELERATED_COMPOSITING) | 224 #endif // USE(ACCELERATED_COMPOSITING) |
OLD | NEW |