Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(253)

Side by Side Diff: cc/render_pass.cc

Issue 11264056: cc: Use gfx:: Geometry types for positions, bounds, and related things. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ScaleAsVector Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/quad_culler_unittest.cc ('k') | cc/render_surface.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 Region fillRegion = occlusionTracker.computeVisibleRegionInScreen(); 85 Region fillRegion = occlusionTracker.computeVisibleRegionInScreen();
86 if (fillRegion.isEmpty()) 86 if (fillRegion.isEmpty())
87 return; 87 return;
88 88
89 bool forSurface = false; 89 bool forSurface = false;
90 QuadCuller quadCuller(m_quadList, m_sharedQuadStateList, rootLayer, &occlusi onTracker, rootLayer->hasDebugBorders(), forSurface); 90 QuadCuller quadCuller(m_quadList, m_sharedQuadStateList, rootLayer, &occlusi onTracker, rootLayer->hasDebugBorders(), forSurface);
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 IntRect 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 Vector<WebCore::IntRect> fillRects = fillRegion.rects();
102 for (size_t i = 0; i < fillRects.size(); ++i) { 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. 103 // The root layer transform is composed of translations and scales only, no perspective, so mapping is sufficient.
104 IntRect layerRect = MathUtil::mapClippedRect(transformToLayerSpace, cc:: IntRect(fillRects[i])); 104 gfx::Rect layerRect = MathUtil::mapClippedRect(transformToLayerSpace, cc ::IntRect(fillRects[i]));
105 // Skip the quad culler and just append the quads directly to avoid occl usion checks. 105 // 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>()); 106 m_quadList.append(SolidColorDrawQuad::create(sharedQuadState, layerRect, screenBackgroundColor).PassAs<DrawQuad>());
107 } 107 }
108 } 108 }
109 109
110 void RenderPass::setFilter(SkImageFilter* filter) { 110 void RenderPass::setFilter(SkImageFilter* filter) {
111 SkRefCnt_SafeAssign(m_filter, filter); 111 SkRefCnt_SafeAssign(m_filter, filter);
112 } 112 }
113 113
114 } // namespace cc 114 } // namespace cc
OLDNEW
« no previous file with comments | « cc/quad_culler_unittest.cc ('k') | cc/render_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698