| 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 "CCRenderPass.h" | 7 #include "CCRenderPass.h" |
| 8 | 8 |
| 9 #include "CCLayerImpl.h" | 9 #include "CCLayerImpl.h" |
| 10 #include "CCMathUtil.h" | 10 #include "CCMathUtil.h" |
| 11 #include "CCOcclusionTracker.h" | 11 #include "CCOcclusionTracker.h" |
| 12 #include "CCQuadCuller.h" | 12 #include "CCQuadCuller.h" |
| 13 #include "CCSharedQuadState.h" | 13 #include "CCSharedQuadState.h" |
| 14 #include "CCSolidColorDrawQuad.h" | 14 #include "CCSolidColorDrawQuad.h" |
| 15 | 15 |
| 16 using WebKit::WebTransformationMatrix; | 16 using WebKit::WebTransformationMatrix; |
| 17 | 17 |
| 18 namespace WebCore { | 18 namespace cc { |
| 19 | 19 |
| 20 PassOwnPtr<CCRenderPass> CCRenderPass::create(Id id, IntRect outputRect, const W
ebKit::WebTransformationMatrix& transformToRootTarget) | 20 PassOwnPtr<CCRenderPass> CCRenderPass::create(Id id, IntRect outputRect, const W
ebKit::WebTransformationMatrix& transformToRootTarget) |
| 21 { | 21 { |
| 22 return adoptPtr(new CCRenderPass(id, outputRect, transformToRootTarget)); | 22 return adoptPtr(new CCRenderPass(id, outputRect, transformToRootTarget)); |
| 23 } | 23 } |
| 24 | 24 |
| 25 CCRenderPass::CCRenderPass(Id id, IntRect outputRect, const WebKit::WebTransform
ationMatrix& transformToRootTarget) | 25 CCRenderPass::CCRenderPass(Id id, IntRect outputRect, const WebKit::WebTransform
ationMatrix& transformToRootTarget) |
| 26 : m_id(id) | 26 : m_id(id) |
| 27 , m_transformToRootTarget(transformToRootTarget) | 27 , m_transformToRootTarget(transformToRootTarget) |
| 28 , m_outputRect(outputRect) | 28 , m_outputRect(outputRect) |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 | 83 |
| 84 // Manually create the quad state for the gutter quads, as the root layer | 84 // Manually create the quad state for the gutter quads, as the root layer |
| 85 // doesn't have any bounds and so can't generate this itself. | 85 // doesn't have any bounds and so can't generate this itself. |
| 86 // FIXME: Make the gutter quads generated by the solid color layer (make it
smarter about generating quads to fill unoccluded areas). | 86 // FIXME: Make the gutter quads generated by the solid color layer (make it
smarter about generating quads to fill unoccluded areas). |
| 87 IntRect rootTargetRect = rootLayer->renderSurface()->contentRect(); | 87 IntRect rootTargetRect = rootLayer->renderSurface()->contentRect(); |
| 88 float opacity = 1; | 88 float opacity = 1; |
| 89 bool opaque = true; | 89 bool opaque = true; |
| 90 CCSharedQuadState* sharedQuadState = quadCuller.useSharedQuadState(CCSharedQ
uadState::create(rootLayer->drawTransform(), rootTargetRect, rootTargetRect, opa
city, opaque)); | 90 CCSharedQuadState* sharedQuadState = quadCuller.useSharedQuadState(CCSharedQ
uadState::create(rootLayer->drawTransform(), rootTargetRect, rootTargetRect, opa
city, opaque)); |
| 91 ASSERT(rootLayer->screenSpaceTransform().isInvertible()); | 91 ASSERT(rootLayer->screenSpaceTransform().isInvertible()); |
| 92 WebTransformationMatrix transformToLayerSpace = rootLayer->screenSpaceTransf
orm().inverse(); | 92 WebTransformationMatrix transformToLayerSpace = rootLayer->screenSpaceTransf
orm().inverse(); |
| 93 Vector<IntRect> fillRects = fillRegion.rects(); | 93 Vector<WebCore::IntRect> fillRects = fillRegion.rects(); |
| 94 for (size_t i = 0; i < fillRects.size(); ++i) { | 94 for (size_t i = 0; i < fillRects.size(); ++i) { |
| 95 // The root layer transform is composed of translations and scales only,
no perspective, so mapping is sufficient. | 95 // The root layer transform is composed of translations and scales only,
no perspective, so mapping is sufficient. |
| 96 IntRect layerRect = CCMathUtil::mapClippedRect(transformToLayerSpace, fi
llRects[i]); | 96 IntRect layerRect = CCMathUtil::mapClippedRect(transformToLayerSpace, cc
::IntRect(fillRects[i])); |
| 97 // Skip the quad culler and just append the quads directly to avoid occl
usion checks. | 97 // Skip the quad culler and just append the quads directly to avoid occl
usion checks. |
| 98 m_quadList.append(CCSolidColorDrawQuad::create(sharedQuadState, layerRec
t, screenBackgroundColor)); | 98 m_quadList.append(CCSolidColorDrawQuad::create(sharedQuadState, layerRec
t, screenBackgroundColor)); |
| 99 } | 99 } |
| 100 } | 100 } |
| 101 | 101 |
| 102 } | 102 } |
| OLD | NEW |