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

Side by Side Diff: cc/layer_impl.h

Issue 11360093: Mark layers that can use LCD text based on layer transform and opacity. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed comments Created 8 years 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
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 #ifndef CC_LAYER_IMPL_H_ 5 #ifndef CC_LAYER_IMPL_H_
6 #define CC_LAYER_IMPL_H_ 6 #define CC_LAYER_IMPL_H_
7 7
8 #include <public/WebFilterOperations.h> 8 #include <public/WebFilterOperations.h>
9 #include <string> 9 #include <string>
10 10
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 144
145 void setFixedToContainerLayer(bool fixedToContainerLayer = true) { m_fixedTo ContainerLayer = fixedToContainerLayer;} 145 void setFixedToContainerLayer(bool fixedToContainerLayer = true) { m_fixedTo ContainerLayer = fixedToContainerLayer;}
146 bool fixedToContainerLayer() const { return m_fixedToContainerLayer; } 146 bool fixedToContainerLayer() const { return m_fixedToContainerLayer; }
147 147
148 void setPreserves3D(bool); 148 void setPreserves3D(bool);
149 bool preserves3D() const { return m_preserves3D; } 149 bool preserves3D() const { return m_preserves3D; }
150 150
151 void setUseParentBackfaceVisibility(bool useParentBackfaceVisibility) { m_us eParentBackfaceVisibility = useParentBackfaceVisibility; } 151 void setUseParentBackfaceVisibility(bool useParentBackfaceVisibility) { m_us eParentBackfaceVisibility = useParentBackfaceVisibility; }
152 bool useParentBackfaceVisibility() const { return m_useParentBackfaceVisibil ity; } 152 bool useParentBackfaceVisibility() const { return m_useParentBackfaceVisibil ity; }
153 153
154 void setUseLCDText(bool useLCDText) { m_useLCDText = useLCDText; }
155 bool useLCDText() const { return m_useLCDText; }
156
157 void setSublayerTransform(const gfx::Transform&); 154 void setSublayerTransform(const gfx::Transform&);
158 const gfx::Transform& sublayerTransform() const { return m_sublayerTransform ; } 155 const gfx::Transform& sublayerTransform() const { return m_sublayerTransform ; }
159 156
160 // Debug layer name. 157 // Debug layer name.
161 void setDebugName(const std::string& debugName) { m_debugName = debugName; } 158 void setDebugName(const std::string& debugName) { m_debugName = debugName; }
162 std::string debugName() const { return m_debugName; } 159 std::string debugName() const { return m_debugName; }
163 160
164 bool showDebugBorders() const; 161 bool showDebugBorders() const;
165 162
166 // These invalidate the host's render surface layer list. The caller 163 // These invalidate the host's render surface layer list. The caller
167 // is responsible for calling setNeedsUpdateDrawProperties on the host 164 // is responsible for calling setNeedsUpdateDrawProperties on the host
168 // so that its list can be recreated. 165 // so that its list can be recreated.
169 void createRenderSurface(); 166 void createRenderSurface();
170 void clearRenderSurface() { m_drawProperties.render_surface.reset(); } 167 void clearRenderSurface() { m_drawProperties.render_surface.reset(); }
171 168
172 DrawProperties<LayerImpl, RenderSurfaceImpl>& drawProperties() { return m_dr awProperties; } 169 DrawProperties<LayerImpl, RenderSurfaceImpl>& drawProperties() { return m_dr awProperties; }
173 const DrawProperties<LayerImpl, RenderSurfaceImpl>& drawProperties() const { return m_drawProperties; } 170 const DrawProperties<LayerImpl, RenderSurfaceImpl>& drawProperties() const { return m_drawProperties; }
174 171
175 // The following are shortcut accessors to get various information from m_dr awProperties 172 // The following are shortcut accessors to get various information from m_dr awProperties
176 const gfx::Transform& drawTransform() const { return m_drawProperties.target _space_transform; } 173 const gfx::Transform& drawTransform() const { return m_drawProperties.target _space_transform; }
177 const gfx::Transform& screenSpaceTransform() const { return m_drawProperties .screen_space_transform; } 174 const gfx::Transform& screenSpaceTransform() const { return m_drawProperties .screen_space_transform; }
178 float drawOpacity() const { return m_drawProperties.opacity; } 175 float drawOpacity() const { return m_drawProperties.opacity; }
179 bool drawOpacityIsAnimating() const { return m_drawProperties.opacity_is_ani mating; } 176 bool drawOpacityIsAnimating() const { return m_drawProperties.opacity_is_ani mating; }
180 bool drawTransformIsAnimating() const { return m_drawProperties.target_space _transform_is_animating; } 177 bool drawTransformIsAnimating() const { return m_drawProperties.target_space _transform_is_animating; }
181 bool screenSpaceTransformIsAnimating() const { return m_drawProperties.scree n_space_transform_is_animating; } 178 bool screenSpaceTransformIsAnimating() const { return m_drawProperties.scree n_space_transform_is_animating; }
179 bool screenSpaceOpacityIsAnimating() const { return m_drawProperties.screen_ space_opacity_is_animating; }
180 bool canUseLCDText() const { return m_drawProperties.can_use_lcd_text; }
182 bool isClipped() const { return m_drawProperties.is_clipped; } 181 bool isClipped() const { return m_drawProperties.is_clipped; }
183 const gfx::Rect& clipRect() const { return m_drawProperties.clip_rect; } 182 const gfx::Rect& clipRect() const { return m_drawProperties.clip_rect; }
184 const gfx::Rect& drawableContentRect() const { return m_drawProperties.drawa ble_content_rect; } 183 const gfx::Rect& drawableContentRect() const { return m_drawProperties.drawa ble_content_rect; }
185 const gfx::Rect& visibleContentRect() const { return m_drawProperties.visibl e_content_rect; } 184 const gfx::Rect& visibleContentRect() const { return m_drawProperties.visibl e_content_rect; }
186 LayerImpl* renderTarget() { DCHECK(!m_drawProperties.render_target || m_draw Properties.render_target->renderSurface()); return m_drawProperties.render_targe t; } 185 LayerImpl* renderTarget() { DCHECK(!m_drawProperties.render_target || m_draw Properties.render_target->renderSurface()); return m_drawProperties.render_targe t; }
187 const LayerImpl* renderTarget() const { DCHECK(!m_drawProperties.render_targ et || m_drawProperties.render_target->renderSurface()); return m_drawProperties. render_target; } 186 const LayerImpl* renderTarget() const { DCHECK(!m_drawProperties.render_targ et || m_drawProperties.render_target->renderSurface()); return m_drawProperties. render_target; }
188 RenderSurfaceImpl* renderSurface() const { return m_drawProperties.render_su rface.get(); } 187 RenderSurfaceImpl* renderSurface() const { return m_drawProperties.render_su rface.get(); }
189 188
190 // The client should be responsible for setting bounds, contentBounds and 189 // The client should be responsible for setting bounds, contentBounds and
191 // contentsScale to appropriate values. LayerImpl doesn't calculate any of 190 // contentsScale to appropriate values. LayerImpl doesn't calculate any of
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 351
353 bool m_masksToBounds; 352 bool m_masksToBounds;
354 bool m_contentsOpaque; 353 bool m_contentsOpaque;
355 float m_opacity; 354 float m_opacity;
356 gfx::PointF m_position; 355 gfx::PointF m_position;
357 bool m_preserves3D; 356 bool m_preserves3D;
358 bool m_useParentBackfaceVisibility; 357 bool m_useParentBackfaceVisibility;
359 bool m_drawCheckerboardForMissingTiles; 358 bool m_drawCheckerboardForMissingTiles;
360 gfx::Transform m_sublayerTransform; 359 gfx::Transform m_sublayerTransform;
361 gfx::Transform m_transform; 360 gfx::Transform m_transform;
362 bool m_useLCDText;
363 361
364 bool m_drawsContent; 362 bool m_drawsContent;
365 bool m_forceRenderSurface; 363 bool m_forceRenderSurface;
366 364
367 // Set for the layer that other layers are fixed to. 365 // Set for the layer that other layers are fixed to.
368 bool m_isContainerForFixedPositionLayers; 366 bool m_isContainerForFixedPositionLayers;
369 // This is true if the layer should be fixed to the closest ancestor contain er. 367 // This is true if the layer should be fixed to the closest ancestor contain er.
370 bool m_fixedToContainerLayer; 368 bool m_fixedToContainerLayer;
371 369
372 gfx::Vector2dF m_scrollDelta; 370 gfx::Vector2dF m_scrollDelta;
(...skipping 30 matching lines...) Expand all
403 // Group of properties that need to be computed based on the layer tree 401 // Group of properties that need to be computed based on the layer tree
404 // hierarchy before layers can be drawn. 402 // hierarchy before layers can be drawn.
405 DrawProperties<LayerImpl, RenderSurfaceImpl> m_drawProperties; 403 DrawProperties<LayerImpl, RenderSurfaceImpl> m_drawProperties;
406 404
407 DISALLOW_COPY_AND_ASSIGN(LayerImpl); 405 DISALLOW_COPY_AND_ASSIGN(LayerImpl);
408 }; 406 };
409 407
410 } 408 }
411 409
412 #endif // CC_LAYER_IMPL_H_ 410 #endif // CC_LAYER_IMPL_H_
OLDNEW
« cc/content_layer.cc ('K') | « cc/layer.cc ('k') | cc/layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698