OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 #include "wtf/OwnPtr.h" | 42 #include "wtf/OwnPtr.h" |
43 #include "wtf/PassOwnPtr.h" | 43 #include "wtf/PassOwnPtr.h" |
44 | 44 |
45 #include "public/platform/WebAnimationDelegate.h" | 45 #include "public/platform/WebAnimationDelegate.h" |
46 #include "public/platform/WebCompositingReasons.h" | 46 #include "public/platform/WebCompositingReasons.h" |
47 #include "public/platform/WebContentLayer.h" | 47 #include "public/platform/WebContentLayer.h" |
48 #include "public/platform/WebImageLayer.h" | 48 #include "public/platform/WebImageLayer.h" |
49 #include "public/platform/WebLayerScrollClient.h" | 49 #include "public/platform/WebLayerScrollClient.h" |
50 #include "public/platform/WebSolidColorLayer.h" | 50 #include "public/platform/WebSolidColorLayer.h" |
51 | 51 |
52 enum LayerTreeAsTextBehaviorFlags { | |
53 LayerTreeAsTextBehaviorNormal = 0, | |
54 LayerTreeAsTextDebug = 1 << 0, // Dump extra debugging info like layer addre
sses. | |
55 LayerTreeAsTextIncludeVisibleRects = 1 << 1, | |
56 LayerTreeAsTextIncludeRepaintRects = 1 << 2, | |
57 LayerTreeAsTextIncludePaintingPhases = 1 << 3 | |
58 }; | |
59 typedef unsigned LayerTreeAsTextBehavior; | |
60 | |
61 enum DebugIDSpecialValues { | 52 enum DebugIDSpecialValues { |
62 DebugIDNoPlatformLayer = -1, | 53 DebugIDNoPlatformLayer = -1, |
63 DebugIDNoCompositedLayer = -2 | 54 DebugIDNoCompositedLayer = -2 |
64 }; | 55 }; |
65 | 56 |
66 namespace WebKit { | 57 namespace WebKit { |
67 class GraphicsLayerFactoryChromium; | 58 class GraphicsLayerFactoryChromium; |
68 class WebLayer; | 59 class WebLayer; |
69 } | 60 } |
70 | 61 |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 | 373 |
383 // For hosting this GraphicsLayer in a native layer hierarchy. | 374 // For hosting this GraphicsLayer in a native layer hierarchy. |
384 WebKit::WebLayer* platformLayer() const; | 375 WebKit::WebLayer* platformLayer() const; |
385 | 376 |
386 enum CompositingCoordinatesOrientation { CompositingCoordinatesTopDown, Comp
ositingCoordinatesBottomUp }; | 377 enum CompositingCoordinatesOrientation { CompositingCoordinatesTopDown, Comp
ositingCoordinatesBottomUp }; |
387 | 378 |
388 // Flippedness of the contents of this layer. Does not affect sublayer geome
try. | 379 // Flippedness of the contents of this layer. Does not affect sublayer geome
try. |
389 void setContentsOrientation(CompositingCoordinatesOrientation orientation) {
m_contentsOrientation = orientation; } | 380 void setContentsOrientation(CompositingCoordinatesOrientation orientation) {
m_contentsOrientation = orientation; } |
390 CompositingCoordinatesOrientation contentsOrientation() const { return m_con
tentsOrientation; } | 381 CompositingCoordinatesOrientation contentsOrientation() const { return m_con
tentsOrientation; } |
391 | 382 |
392 void dumpLayer(TextStream&, int indent = 0, LayerTreeAsTextBehavior = LayerT
reeAsTextBehaviorNormal) const; | 383 void dumpLayer(TextStream&, int indent = 0, LayerTreeFlags = LayerTreeNormal
) const; |
393 | 384 |
394 void setShowDebugBorder(bool show) { m_showDebugBorder = show; } | 385 void setShowDebugBorder(bool show) { m_showDebugBorder = show; } |
395 bool isShowingDebugBorder() const { return m_showDebugBorder; } | 386 bool isShowingDebugBorder() const { return m_showDebugBorder; } |
396 | 387 |
397 void setShowRepaintCounter(bool show) { m_showRepaintCounter = show; } | 388 void setShowRepaintCounter(bool show) { m_showRepaintCounter = show; } |
398 bool isShowingRepaintCounter() const { return m_showRepaintCounter; } | 389 bool isShowingRepaintCounter() const { return m_showRepaintCounter; } |
399 | 390 |
400 // FIXME: this is really a paint count. | 391 // FIXME: this is really a paint count. |
401 int repaintCount() const { return m_repaintCount; } | 392 int repaintCount() const { return m_repaintCount; } |
402 int incrementRepaintCount() { return ++m_repaintCount; } | 393 int incrementRepaintCount() { return ++m_repaintCount; } |
403 | 394 |
404 void setDebugBackgroundColor(const Color&) { } | 395 void setDebugBackgroundColor(const Color&) { } |
405 void setDebugBorder(const Color&, float /*borderWidth*/) { } | 396 void setDebugBorder(const Color&, float /*borderWidth*/) { } |
406 | 397 |
407 // z-position is the z-equivalent of position(). It's only used for debuggin
g purposes. | 398 // z-position is the z-equivalent of position(). It's only used for debuggin
g purposes. |
408 float zPosition() const { return m_zPosition; } | 399 float zPosition() const { return m_zPosition; } |
409 void setZPosition(float); | 400 void setZPosition(float); |
410 | 401 |
411 void distributeOpacity(float); | 402 void distributeOpacity(float); |
412 float accumulatedOpacity() const; | 403 float accumulatedOpacity() const; |
413 | 404 |
414 // If the exposed rect of this layer changes, returns true if this or descen
dant layers need a flush, | 405 // If the exposed rect of this layer changes, returns true if this or descen
dant layers need a flush, |
415 // for example to allocate new tiles. | 406 // for example to allocate new tiles. |
416 bool visibleRectChangeRequiresFlush(const FloatRect& /* clipRect */) const {
return false; } | 407 bool visibleRectChangeRequiresFlush(const FloatRect& /* clipRect */) const {
return false; } |
417 | 408 |
418 // Return a string with a human readable form of the layer tree, If debug is
true | 409 // Return a string with a human readable form of the layer tree, If debug is
true |
419 // pointers for the layers and timing data will be included in the returned
string. | 410 // pointers for the layers and timing data will be included in the returned
string. |
420 String layerTreeAsText(LayerTreeAsTextBehavior = LayerTreeAsTextBehaviorNorm
al) const; | 411 String layerTreeAsText(LayerTreeFlags = LayerTreeNormal) const; |
421 | 412 |
422 // Return an estimate of the backing store memory cost (in bytes). May be in
correct for tiled layers. | 413 // Return an estimate of the backing store memory cost (in bytes). May be in
correct for tiled layers. |
423 double backingStoreMemoryEstimate() const; | 414 double backingStoreMemoryEstimate() const; |
424 | 415 |
425 void resetTrackedRepaints(); | 416 void resetTrackedRepaints(); |
426 void addRepaintRect(const FloatRect&); | 417 void addRepaintRect(const FloatRect&); |
427 | 418 |
428 static bool supportsBackgroundColorContent() | 419 static bool supportsBackgroundColorContent() |
429 { | 420 { |
430 return false; | 421 return false; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
482 // The layer being replicated. | 473 // The layer being replicated. |
483 GraphicsLayer* replicatedLayer() const { return m_replicatedLayer; } | 474 GraphicsLayer* replicatedLayer() const { return m_replicatedLayer; } |
484 void setReplicatedLayer(GraphicsLayer* layer) { m_replicatedLayer = layer; } | 475 void setReplicatedLayer(GraphicsLayer* layer) { m_replicatedLayer = layer; } |
485 | 476 |
486 // Any factory classes that want to create a GraphicsLayer need to be friend
s. | 477 // Any factory classes that want to create a GraphicsLayer need to be friend
s. |
487 friend class WebKit::GraphicsLayerFactoryChromium; | 478 friend class WebKit::GraphicsLayerFactoryChromium; |
488 explicit GraphicsLayer(GraphicsLayerClient*); | 479 explicit GraphicsLayer(GraphicsLayerClient*); |
489 | 480 |
490 static void writeIndent(TextStream&, int indent); | 481 static void writeIndent(TextStream&, int indent); |
491 | 482 |
492 void dumpProperties(TextStream&, int indent, LayerTreeAsTextBehavior) const; | 483 void dumpProperties(TextStream&, int indent, LayerTreeFlags) const; |
493 void dumpAdditionalProperties(TextStream&, int /*indent*/, LayerTreeAsTextBe
havior) const { } | 484 void dumpAdditionalProperties(TextStream&, int /*indent*/, LayerTreeFlags) c
onst { } |
494 | 485 |
495 void getDebugBorderInfo(Color&, float& width) const; | 486 void getDebugBorderInfo(Color&, float& width) const; |
496 | 487 |
497 // Helper functions used by settors to keep layer's the state consistent. | 488 // Helper functions used by settors to keep layer's the state consistent. |
498 void updateNames(); | 489 void updateNames(); |
499 void updateChildList(); | 490 void updateChildList(); |
500 void updateLayerIsDrawable(); | 491 void updateLayerIsDrawable(); |
501 void updateContentsRect(); | 492 void updateContentsRect(); |
502 | 493 |
503 void setContentsTo(ContentsLayerPurpose, WebKit::WebLayer*); | 494 void setContentsTo(ContentsLayerPurpose, WebKit::WebLayer*); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
581 | 572 |
582 | 573 |
583 } // namespace WebCore | 574 } // namespace WebCore |
584 | 575 |
585 #ifndef NDEBUG | 576 #ifndef NDEBUG |
586 // Outside the WebCore namespace for ease of invocation from gdb. | 577 // Outside the WebCore namespace for ease of invocation from gdb. |
587 void showGraphicsLayerTree(const WebCore::GraphicsLayer* layer); | 578 void showGraphicsLayerTree(const WebCore::GraphicsLayer* layer); |
588 #endif | 579 #endif |
589 | 580 |
590 #endif // GraphicsLayer_h | 581 #endif // GraphicsLayer_h |
OLD | NEW |