OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 "CCDirectRenderer.h" | 7 #include "CCDirectRenderer.h" |
8 | 8 |
9 #include "CCMathUtil.h" | 9 #include "CCMathUtil.h" |
10 #include <public/WebTransformationMatrix.h> | 10 #include <public/WebTransformationMatrix.h> |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 WebTransformationMatrix inverseTransformToRoot = frame.currentRenderPass
->transformToRootTarget().inverse(); | 164 WebTransformationMatrix inverseTransformToRoot = frame.currentRenderPass
->transformToRootTarget().inverse(); |
165 frame.scissorRectInRenderPassSpace.intersect(CCMathUtil::projectClippedR
ect(inverseTransformToRoot, frame.rootDamageRect)); | 165 frame.scissorRectInRenderPassSpace.intersect(CCMathUtil::projectClippedR
ect(inverseTransformToRoot, frame.rootDamageRect)); |
166 } | 166 } |
167 | 167 |
168 enableScissorTestRect(moveScissorToWindowSpace(frame, frame.scissorRectInRen
derPassSpace)); | 168 enableScissorTestRect(moveScissorToWindowSpace(frame, frame.scissorRectInRen
derPassSpace)); |
169 clearFramebuffer(frame); | 169 clearFramebuffer(frame); |
170 | 170 |
171 const CCQuadList& quadList = renderPass->quadList(); | 171 const CCQuadList& quadList = renderPass->quadList(); |
172 for (CCQuadList::constBackToFrontIterator it = quadList.backToFrontBegin();
it != quadList.backToFrontEnd(); ++it) { | 172 for (CCQuadList::constBackToFrontIterator it = quadList.backToFrontBegin();
it != quadList.backToFrontEnd(); ++it) { |
173 FloatRect quadScissorRect = frame.scissorRectInRenderPassSpace; | 173 FloatRect quadScissorRect = frame.scissorRectInRenderPassSpace; |
174 quadScissorRect.intersect(it->get()->clippedRectInTarget()); | 174 quadScissorRect.intersect((*it)->clippedRectInTarget()); |
175 if (!quadScissorRect.isEmpty()) { | 175 if (!quadScissorRect.isEmpty()) { |
176 enableScissorTestRect(moveScissorToWindowSpace(frame, quadScissorRec
t)); | 176 enableScissorTestRect(moveScissorToWindowSpace(frame, quadScissorRec
t)); |
177 drawQuad(frame, it->get()); | 177 drawQuad(frame, *it); |
178 } | 178 } |
179 } | 179 } |
180 | 180 |
181 CachedTexture* texture = m_renderPassTextures.get(renderPass->id()); | 181 CachedTexture* texture = m_renderPassTextures.get(renderPass->id()); |
182 if (texture) | 182 if (texture) |
183 texture->setIsComplete(!renderPass->hasOcclusionFromOutsideTargetSurface
()); | 183 texture->setIsComplete(!renderPass->hasOcclusionFromOutsideTargetSurface
()); |
184 } | 184 } |
185 | 185 |
186 bool CCDirectRenderer::useRenderPass(DrawingFrame& frame, const CCRenderPass* re
nderPass) | 186 bool CCDirectRenderer::useRenderPass(DrawingFrame& frame, const CCRenderPass* re
nderPass) |
187 { | 187 { |
(...skipping 27 matching lines...) Expand all Loading... |
215 return pass->outputRect().size(); | 215 return pass->outputRect().size(); |
216 } | 216 } |
217 | 217 |
218 // static | 218 // static |
219 GC3Denum CCDirectRenderer::renderPassTextureFormat(const CCRenderPass*) | 219 GC3Denum CCDirectRenderer::renderPassTextureFormat(const CCRenderPass*) |
220 { | 220 { |
221 return GraphicsContext3D::RGBA; | 221 return GraphicsContext3D::RGBA; |
222 } | 222 } |
223 | 223 |
224 } | 224 } |
OLD | NEW |