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 "cc/render_pass.h" | 7 #include "cc/render_pass.h" |
8 | 8 |
9 #include "cc/layer_impl.h" | 9 #include "cc/layer_impl.h" |
10 #include "cc/math_util.h" | 10 #include "cc/math_util.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 | 91 |
92 // Manually create the quad state for the gutter quads, as the root layer | 92 // Manually create the quad state for the gutter quads, as the root layer |
93 // doesn't have any bounds and so can't generate this itself. | 93 // doesn't have any bounds and so can't generate this itself. |
94 // FIXME: Make the gutter quads generated by the solid color layer (make it
smarter about generating quads to fill unoccluded areas). | 94 // FIXME: Make the gutter quads generated by the solid color layer (make it
smarter about generating quads to fill unoccluded areas). |
95 gfx::Rect rootTargetRect = rootLayer->renderSurface()->contentRect(); | 95 gfx::Rect rootTargetRect = rootLayer->renderSurface()->contentRect(); |
96 float opacity = 1; | 96 float opacity = 1; |
97 bool opaque = true; | 97 bool opaque = true; |
98 SharedQuadState* sharedQuadState = quadCuller.useSharedQuadState(SharedQuadS
tate::create(rootLayer->drawTransform(), rootTargetRect, rootTargetRect, opacity
, opaque)); | 98 SharedQuadState* sharedQuadState = quadCuller.useSharedQuadState(SharedQuadS
tate::create(rootLayer->drawTransform(), rootTargetRect, rootTargetRect, opacity
, opaque)); |
99 DCHECK(rootLayer->screenSpaceTransform().isInvertible()); | 99 DCHECK(rootLayer->screenSpaceTransform().isInvertible()); |
100 WebTransformationMatrix transformToLayerSpace = rootLayer->screenSpaceTransf
orm().inverse(); | 100 WebTransformationMatrix transformToLayerSpace = rootLayer->screenSpaceTransf
orm().inverse(); |
101 Vector<WebCore::IntRect> fillRects = fillRegion.rects(); | 101 for (Region::Iterator fillRects(fillRegion); fillRects.has_rect(); fillRects
.next()) { |
102 for (size_t i = 0; i < fillRects.size(); ++i) { | |
103 // The root layer transform is composed of translations and scales only,
no perspective, so mapping is sufficient. | 102 // The root layer transform is composed of translations and scales only,
no perspective, so mapping is sufficient. |
104 gfx::Rect layerRect = MathUtil::mapClippedRect(transformToLayerSpace, cc
::IntRect(fillRects[i])); | 103 gfx::Rect layerRect = MathUtil::mapClippedRect(transformToLayerSpace, fi
llRects.rect()); |
105 // Skip the quad culler and just append the quads directly to avoid occl
usion checks. | 104 // Skip the quad culler and just append the quads directly to avoid occl
usion checks. |
106 m_quadList.append(SolidColorDrawQuad::create(sharedQuadState, layerRect,
screenBackgroundColor).PassAs<DrawQuad>()); | 105 m_quadList.append(SolidColorDrawQuad::create(sharedQuadState, layerRect,
screenBackgroundColor).PassAs<DrawQuad>()); |
107 } | 106 } |
108 } | 107 } |
109 | 108 |
110 void RenderPass::setFilter(SkImageFilter* filter) { | 109 void RenderPass::setFilter(SkImageFilter* filter) { |
111 SkRefCnt_SafeAssign(m_filter, filter); | 110 SkRefCnt_SafeAssign(m_filter, filter); |
112 } | 111 } |
113 | 112 |
114 } // namespace cc | 113 } // namespace cc |
OLD | NEW |