| 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 WebCore { |
| 19 | 19 |
| 20 PassOwnPtr<CCRenderPass> CCRenderPass::create(int id, IntRect outputRect, const
WebKit::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(int id, IntRect outputRect, const WebKit::WebTransfor
mationMatrix& 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) |
| 29 , m_hasTransparentBackground(true) | 29 , m_hasTransparentBackground(true) |
| 30 , m_hasOcclusionFromOutsideTargetSurface(false) | 30 , m_hasOcclusionFromOutsideTargetSurface(false) |
| 31 { | 31 { |
| 32 ASSERT(id > 0); | 32 ASSERT(id.layerId > 0); |
| 33 ASSERT(id.index >= 0); |
| 34 } |
| 35 |
| 36 PassOwnPtr<CCRenderPass> CCRenderPass::copy(Id newId) const |
| 37 { |
| 38 ASSERT(newId != m_id); |
| 39 |
| 40 OwnPtr<CCRenderPass> copyPass(create(newId, m_outputRect, m_transformToRootT
arget)); |
| 41 copyPass->setDamageRect(m_damageRect); |
| 42 copyPass->setHasTransparentBackground(m_hasTransparentBackground); |
| 43 copyPass->setHasOcclusionFromOutsideTargetSurface(m_hasOcclusionFromOutsideT
argetSurface); |
| 44 copyPass->setFilters(m_filters); |
| 45 copyPass->setBackgroundFilters(m_backgroundFilters); |
| 46 return copyPass.release(); |
| 33 } | 47 } |
| 34 | 48 |
| 35 void CCRenderPass::appendQuadsForLayer(CCLayerImpl* layer, CCOcclusionTrackerImp
l* occlusionTracker, CCAppendQuadsData& appendQuadsData) | 49 void CCRenderPass::appendQuadsForLayer(CCLayerImpl* layer, CCOcclusionTrackerImp
l* occlusionTracker, CCAppendQuadsData& appendQuadsData) |
| 36 { | 50 { |
| 37 const bool forSurface = false; | 51 const bool forSurface = false; |
| 38 CCQuadCuller quadCuller(m_quadList, m_sharedQuadStateList, layer, occlusionT
racker, layer->hasDebugBorders(), forSurface); | 52 CCQuadCuller quadCuller(m_quadList, m_sharedQuadStateList, layer, occlusionT
racker, layer->hasDebugBorders(), forSurface); |
| 39 | 53 |
| 40 layer->appendQuads(quadCuller, appendQuadsData); | 54 layer->appendQuads(quadCuller, appendQuadsData); |
| 41 } | 55 } |
| 42 | 56 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 Vector<IntRect> fillRects = fillRegion.rects(); | 93 Vector<IntRect> fillRects = fillRegion.rects(); |
| 80 for (size_t i = 0; i < fillRects.size(); ++i) { | 94 for (size_t i = 0; i < fillRects.size(); ++i) { |
| 81 // 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. |
| 82 IntRect layerRect = CCMathUtil::mapClippedRect(transformToLayerSpace, fi
llRects[i]); | 96 IntRect layerRect = CCMathUtil::mapClippedRect(transformToLayerSpace, fi
llRects[i]); |
| 83 // 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. |
| 84 m_quadList.append(CCSolidColorDrawQuad::create(sharedQuadState, layerRec
t, screenBackgroundColor)); | 98 m_quadList.append(CCSolidColorDrawQuad::create(sharedQuadState, layerRec
t, screenBackgroundColor)); |
| 85 } | 99 } |
| 86 } | 100 } |
| 87 | 101 |
| 88 } | 102 } |
| OLD | NEW |