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 #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 <string> | 8 #include <string> |
9 | 9 |
10 #include "FloatSize.h" | |
11 #include "IntPoint.h" | |
12 #include "Region.h" | 10 #include "Region.h" |
13 #include "base/logging.h" | 11 #include "base/logging.h" |
14 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
15 #include "cc/cc_export.h" | 13 #include "cc/cc_export.h" |
16 #include "cc/input_handler.h" | 14 #include "cc/input_handler.h" |
17 #include "cc/layer_animation_controller.h" | 15 #include "cc/layer_animation_controller.h" |
18 #include "cc/render_pass.h" | 16 #include "cc/render_pass.h" |
19 #include "cc/render_surface_impl.h" | 17 #include "cc/render_surface_impl.h" |
20 #include "cc/resource_provider.h" | 18 #include "cc/resource_provider.h" |
21 #include "cc/scoped_ptr_vector.h" | 19 #include "cc/scoped_ptr_vector.h" |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 | 178 |
181 // ContentBounds may be [0, 1) pixels larger than bounds * contentsScale. | 179 // ContentBounds may be [0, 1) pixels larger than bounds * contentsScale. |
182 // Don't calculate scale from it. Use contentsScale instead for accuracy. | 180 // Don't calculate scale from it. Use contentsScale instead for accuracy. |
183 void setContentBounds(const gfx::Size&); | 181 void setContentBounds(const gfx::Size&); |
184 gfx::Size contentBounds() const { return m_contentBounds; } | 182 gfx::Size contentBounds() const { return m_contentBounds; } |
185 | 183 |
186 float contentsScaleX() const { return m_contentsScaleX; } | 184 float contentsScaleX() const { return m_contentsScaleX; } |
187 float contentsScaleY() const { return m_contentsScaleY; } | 185 float contentsScaleY() const { return m_contentsScaleY; } |
188 void setContentsScale(float contentsScaleX, float contentsScaleY); | 186 void setContentsScale(float contentsScaleX, float contentsScaleY); |
189 | 187 |
190 const IntPoint& scrollPosition() const { return m_scrollPosition; } | 188 gfx::Vector2d scrollOffset() const { return m_scrollOffset; } |
191 void setScrollPosition(const IntPoint&); | 189 void setScrollOffset(gfx::Vector2d); |
192 | 190 |
193 const IntSize& maxScrollPosition() const {return m_maxScrollPosition; } | 191 gfx::Vector2d maxScrollOffset() const {return m_maxScrollOffset; } |
194 void setMaxScrollPosition(const IntSize&); | 192 void setMaxScrollOffset(gfx::Vector2d); |
195 | 193 |
196 const FloatSize& scrollDelta() const { return m_scrollDelta; } | 194 const gfx::Vector2dF& scrollDelta() const { return m_scrollDelta; } |
197 void setScrollDelta(const FloatSize&); | 195 void setScrollDelta(const gfx::Vector2dF&); |
198 | 196 |
199 const WebKit::WebTransformationMatrix& implTransform() const { return m_impl
Transform; } | 197 const WebKit::WebTransformationMatrix& implTransform() const { return m_impl
Transform; } |
200 void setImplTransform(const WebKit::WebTransformationMatrix& transform); | 198 void setImplTransform(const WebKit::WebTransformationMatrix& transform); |
201 | 199 |
202 const IntSize& sentScrollDelta() const { return m_sentScrollDelta; } | 200 const gfx::Vector2d& sentScrollDelta() const { return m_sentScrollDelta; } |
203 void setSentScrollDelta(const IntSize& sentScrollDelta) { m_sentScrollDelta
= sentScrollDelta; } | 201 void setSentScrollDelta(const gfx::Vector2d& sentScrollDelta) { m_sentScroll
Delta = sentScrollDelta; } |
204 | 202 |
205 // Returns the delta of the scroll that was outside of the bounds of the ini
tial scroll | 203 // Returns the delta of the scroll that was outside of the bounds of the ini
tial scroll |
206 FloatSize scrollBy(const FloatSize& scroll); | 204 gfx::Vector2dF scrollBy(const gfx::Vector2dF& scroll); |
207 | 205 |
208 bool scrollable() const { return m_scrollable; } | 206 bool scrollable() const { return m_scrollable; } |
209 void setScrollable(bool scrollable) { m_scrollable = scrollable; } | 207 void setScrollable(bool scrollable) { m_scrollable = scrollable; } |
210 | 208 |
211 bool shouldScrollOnMainThread() const { return m_shouldScrollOnMainThread; } | 209 bool shouldScrollOnMainThread() const { return m_shouldScrollOnMainThread; } |
212 void setShouldScrollOnMainThread(bool shouldScrollOnMainThread) { m_shouldSc
rollOnMainThread = shouldScrollOnMainThread; } | 210 void setShouldScrollOnMainThread(bool shouldScrollOnMainThread) { m_shouldSc
rollOnMainThread = shouldScrollOnMainThread; } |
213 | 211 |
214 bool haveWheelEventHandlers() const { return m_haveWheelEventHandlers; } | 212 bool haveWheelEventHandlers() const { return m_haveWheelEventHandlers; } |
215 void setHaveWheelEventHandlers(bool haveWheelEventHandlers) { m_haveWheelEve
ntHandlers = haveWheelEventHandlers; } | 213 void setHaveWheelEventHandlers(bool haveWheelEventHandlers) { m_haveWheelEve
ntHandlers = haveWheelEventHandlers; } |
216 | 214 |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 int m_layerId; | 307 int m_layerId; |
310 LayerTreeHostImpl* m_layerTreeHostImpl; | 308 LayerTreeHostImpl* m_layerTreeHostImpl; |
311 | 309 |
312 // Properties synchronized from the associated Layer. | 310 // Properties synchronized from the associated Layer. |
313 gfx::PointF m_anchorPoint; | 311 gfx::PointF m_anchorPoint; |
314 float m_anchorPointZ; | 312 float m_anchorPointZ; |
315 gfx::Size m_bounds; | 313 gfx::Size m_bounds; |
316 gfx::Size m_contentBounds; | 314 gfx::Size m_contentBounds; |
317 float m_contentsScaleX; | 315 float m_contentsScaleX; |
318 float m_contentsScaleY; | 316 float m_contentsScaleY; |
319 IntPoint m_scrollPosition; | 317 gfx::Vector2d m_scrollOffset; |
320 bool m_scrollable; | 318 bool m_scrollable; |
321 bool m_shouldScrollOnMainThread; | 319 bool m_shouldScrollOnMainThread; |
322 bool m_haveWheelEventHandlers; | 320 bool m_haveWheelEventHandlers; |
323 Region m_nonFastScrollableRegion; | 321 Region m_nonFastScrollableRegion; |
324 SkColor m_backgroundColor; | 322 SkColor m_backgroundColor; |
325 | 323 |
326 // Whether the "back" of this layer should draw. | 324 // Whether the "back" of this layer should draw. |
327 bool m_doubleSided; | 325 bool m_doubleSided; |
328 | 326 |
329 // Tracks if drawing-related properties have changed since last redraw. | 327 // Tracks if drawing-related properties have changed since last redraw. |
(...skipping 19 matching lines...) Expand all Loading... |
349 bool m_useLCDText; | 347 bool m_useLCDText; |
350 | 348 |
351 bool m_drawsContent; | 349 bool m_drawsContent; |
352 bool m_forceRenderSurface; | 350 bool m_forceRenderSurface; |
353 | 351 |
354 // Set for the layer that other layers are fixed to. | 352 // Set for the layer that other layers are fixed to. |
355 bool m_isContainerForFixedPositionLayers; | 353 bool m_isContainerForFixedPositionLayers; |
356 // This is true if the layer should be fixed to the closest ancestor contain
er. | 354 // This is true if the layer should be fixed to the closest ancestor contain
er. |
357 bool m_fixedToContainerLayer; | 355 bool m_fixedToContainerLayer; |
358 | 356 |
359 FloatSize m_scrollDelta; | 357 gfx::Vector2dF m_scrollDelta; |
360 IntSize m_sentScrollDelta; | 358 gfx::Vector2d m_sentScrollDelta; |
361 IntSize m_maxScrollPosition; | 359 gfx::Vector2d m_maxScrollOffset; |
362 WebKit::WebTransformationMatrix m_implTransform; | 360 WebKit::WebTransformationMatrix m_implTransform; |
363 | 361 |
364 // The layer whose coordinate space this layer draws into. This can be | 362 // The layer whose coordinate space this layer draws into. This can be |
365 // either the same layer (m_renderTarget == this) or an ancestor of this | 363 // either the same layer (m_renderTarget == this) or an ancestor of this |
366 // layer. | 364 // layer. |
367 LayerImpl* m_renderTarget; | 365 LayerImpl* m_renderTarget; |
368 | 366 |
369 // The global depth value of the center of the layer. This value is used | 367 // The global depth value of the center of the layer. This value is used |
370 // to sort layers from back to front. | 368 // to sort layers from back to front. |
371 float m_drawDepth; | 369 float m_drawDepth; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 scoped_ptr<ScrollbarAnimationController> m_scrollbarAnimationController; | 410 scoped_ptr<ScrollbarAnimationController> m_scrollbarAnimationController; |
413 | 411 |
414 DISALLOW_COPY_AND_ASSIGN(LayerImpl); | 412 DISALLOW_COPY_AND_ASSIGN(LayerImpl); |
415 }; | 413 }; |
416 | 414 |
417 void sortLayers(std::vector<LayerImpl*>::iterator first, std::vector<LayerImpl*>
::iterator end, LayerSorter*); | 415 void sortLayers(std::vector<LayerImpl*>::iterator first, std::vector<LayerImpl*>
::iterator end, LayerSorter*); |
418 | 416 |
419 } | 417 } |
420 | 418 |
421 #endif // CC_LAYER_IMPL_H_ | 419 #endif // CC_LAYER_IMPL_H_ |
OLD | NEW |