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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 texture->setIsComplete(!renderPass->hasOcclusionFromOutsideTargetSurface
()); | 206 texture->setIsComplete(!renderPass->hasOcclusionFromOutsideTargetSurface
()); |
207 } | 207 } |
208 | 208 |
209 bool CCDirectRenderer::useRenderPass(DrawingFrame& frame, const CCRenderPass* re
nderPass) | 209 bool CCDirectRenderer::useRenderPass(DrawingFrame& frame, const CCRenderPass* re
nderPass) |
210 { | 210 { |
211 frame.currentRenderPass = renderPass; | 211 frame.currentRenderPass = renderPass; |
212 frame.currentTexture = 0; | 212 frame.currentTexture = 0; |
213 | 213 |
214 if (renderPass == frame.rootRenderPass) { | 214 if (renderPass == frame.rootRenderPass) { |
215 bindFramebufferToOutputSurface(frame); | 215 bindFramebufferToOutputSurface(frame); |
216 initializeMatrices(frame, renderPass->outputRect(), true); | 216 initializeMatrices(frame, renderPass->outputRect(), flippedFramebuffer()
); |
217 setDrawViewportSize(renderPass->outputRect().size()); | 217 setDrawViewportSize(renderPass->outputRect().size()); |
218 return true; | 218 return true; |
219 } | 219 } |
220 | 220 |
221 CachedTexture* texture = m_renderPassTextures.get(renderPass->id()); | 221 CachedTexture* texture = m_renderPassTextures.get(renderPass->id()); |
222 ASSERT(texture); | 222 ASSERT(texture); |
223 if (!texture->id() && !texture->allocate(CCRenderer::ImplPool, renderPassTex
tureSize(renderPass), renderPassTextureFormat(renderPass), CCResourceProvider::T
extureUsageFramebuffer)) | 223 if (!texture->id() && !texture->allocate(CCRenderer::ImplPool, renderPassTex
tureSize(renderPass), renderPassTextureFormat(renderPass), CCResourceProvider::T
extureUsageFramebuffer)) |
224 return false; | 224 return false; |
225 | 225 |
226 return bindFramebufferToTexture(frame, texture, renderPass->outputRect()); | 226 return bindFramebufferToTexture(frame, texture, renderPass->outputRect()); |
(...skipping 11 matching lines...) Expand all Loading... |
238 return pass->outputRect().size(); | 238 return pass->outputRect().size(); |
239 } | 239 } |
240 | 240 |
241 // static | 241 // static |
242 GC3Denum CCDirectRenderer::renderPassTextureFormat(const CCRenderPass*) | 242 GC3Denum CCDirectRenderer::renderPassTextureFormat(const CCRenderPass*) |
243 { | 243 { |
244 return GraphicsContext3D::RGBA; | 244 return GraphicsContext3D::RGBA; |
245 } | 245 } |
246 | 246 |
247 } | 247 } |
OLD | NEW |