| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2013 Intel Corporation. All rights reserved. | 3 * Copyright (C) 2013 Intel Corporation. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 // Some GraphicsLayers paint only the foreground or the background content | 179 // Some GraphicsLayers paint only the foreground or the background content |
| 180 GraphicsLayerPaintingPhase paintingPhase() const { return m_paintingPhase; } | 180 GraphicsLayerPaintingPhase paintingPhase() const { return m_paintingPhase; } |
| 181 void setPaintingPhase(GraphicsLayerPaintingPhase); | 181 void setPaintingPhase(GraphicsLayerPaintingPhase); |
| 182 | 182 |
| 183 void setNeedsDisplay(); | 183 void setNeedsDisplay(); |
| 184 // Mark the given rect (in layer coords) as needing display. Never goes deep
. | 184 // Mark the given rect (in layer coords) as needing display. Never goes deep
. |
| 185 void setNeedsDisplayInRect(const IntRect&, PaintInvalidationReason, const Di
splayItemClient&); | 185 void setNeedsDisplayInRect(const IntRect&, PaintInvalidationReason, const Di
splayItemClient&); |
| 186 | 186 |
| 187 void setContentsNeedsDisplay(); | 187 void setContentsNeedsDisplay(); |
| 188 | 188 |
| 189 // This is called only if we are tracking paint invalidation for testing, or
ENABLE(ASSERT) | |
| 190 // for error checking and debugging. | |
| 191 void displayItemClientWasInvalidated(const DisplayItemClient&, PaintInvalida
tionReason); | |
| 192 | |
| 193 // Set that the position/size of the contents (image or video). | 189 // Set that the position/size of the contents (image or video). |
| 194 void setContentsRect(const IntRect&); | 190 void setContentsRect(const IntRect&); |
| 195 | 191 |
| 196 // Layer contents | 192 // Layer contents |
| 197 void setContentsToImage(Image*, RespectImageOrientationEnum = DoNotRespectIm
ageOrientation); | 193 void setContentsToImage(Image*, RespectImageOrientationEnum = DoNotRespectIm
ageOrientation); |
| 198 void setContentsToPlatformLayer(WebLayer* layer) { setContentsTo(layer); } | 194 void setContentsToPlatformLayer(WebLayer* layer) { setContentsTo(layer); } |
| 199 bool hasContentsLayer() const { return m_contentsLayer; } | 195 bool hasContentsLayer() const { return m_contentsLayer; } |
| 200 | 196 |
| 201 // For hosting this GraphicsLayer in a native layer hierarchy. | 197 // For hosting this GraphicsLayer in a native layer hierarchy. |
| 202 WebLayer* platformLayer() const; | 198 WebLayer* platformLayer() const; |
| 203 | 199 |
| 204 typedef HashMap<int, int> RenderingContextMap; | |
| 205 PassRefPtr<JSONObject> layerTreeAsJSON(LayerTreeFlags, RenderingContextMap&)
const; | |
| 206 | |
| 207 int paintCount() const { return m_paintCount; } | 200 int paintCount() const { return m_paintCount; } |
| 208 | 201 |
| 209 // Return a string with a human readable form of the layer tree, If debug is
true | 202 // Return a string with a human readable form of the layer tree, If debug is
true |
| 210 // pointers for the layers and timing data will be included in the returned
string. | 203 // pointers for the layers and timing data will be included in the returned
string. |
| 211 String layerTreeAsText(LayerTreeFlags = LayerTreeNormal) const; | 204 String layerTreeAsText(LayerTreeFlags = LayerTreeNormal) const; |
| 212 | 205 |
| 206 PassRefPtr<JSONObject> layerTreeAsJSON(LayerTreeFlags) const; |
| 207 |
| 213 void setTracksPaintInvalidations(bool); | 208 void setTracksPaintInvalidations(bool); |
| 214 bool isTrackingOrCheckingPaintInvalidations() const | 209 bool isTrackingOrCheckingPaintInvalidations() const |
| 215 { | 210 { |
| 216 #if DCHECK_IS_ON() | 211 #if DCHECK_IS_ON() |
| 217 if (RuntimeEnabledFeatures::slimmingPaintUnderInvalidationCheckingEnable
d()) | 212 if (RuntimeEnabledFeatures::slimmingPaintUnderInvalidationCheckingEnable
d()) |
| 218 return true; | 213 return true; |
| 219 #endif | 214 #endif |
| 220 return m_isTrackingPaintInvalidations; | 215 return m_isTrackingPaintInvalidations; |
| 221 } | 216 } |
| 222 | 217 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 // Helper functions used by settors to keep layer's the state consistent. | 289 // Helper functions used by settors to keep layer's the state consistent. |
| 295 void updateChildList(); | 290 void updateChildList(); |
| 296 void updateLayerIsDrawable(); | 291 void updateLayerIsDrawable(); |
| 297 void updateContentsRect(); | 292 void updateContentsRect(); |
| 298 | 293 |
| 299 void setContentsTo(WebLayer*); | 294 void setContentsTo(WebLayer*); |
| 300 void setupContentsLayer(WebLayer*); | 295 void setupContentsLayer(WebLayer*); |
| 301 void clearContentsLayerIfUnregistered(); | 296 void clearContentsLayerIfUnregistered(); |
| 302 WebLayer* contentsLayerIfRegistered(); | 297 WebLayer* contentsLayerIfRegistered(); |
| 303 | 298 |
| 299 typedef HashMap<int, int> RenderingContextMap; |
| 300 PassRefPtr<JSONObject> layerTreeAsJSONInternal(LayerTreeFlags, RenderingCont
extMap&) const; |
| 301 |
| 304 #if DCHECK_IS_ON() | 302 #if DCHECK_IS_ON() |
| 305 PassRefPtr<SkPicture> capturePicture(); | 303 PassRefPtr<SkPicture> capturePicture(); |
| 306 void checkPaintUnderInvalidations(const SkPicture&); | 304 void checkPaintUnderInvalidations(const SkPicture&); |
| 307 #endif | 305 #endif |
| 308 | 306 |
| 309 GraphicsLayerClient* m_client; | 307 GraphicsLayerClient* m_client; |
| 310 | 308 |
| 311 // Offset from the owning layoutObject | 309 // Offset from the owning layoutObject |
| 312 DoubleSize m_offsetFromLayoutObject; | 310 DoubleSize m_offsetFromLayoutObject; |
| 313 | 311 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 }; | 382 }; |
| 385 | 383 |
| 386 } // namespace blink | 384 } // namespace blink |
| 387 | 385 |
| 388 #ifndef NDEBUG | 386 #ifndef NDEBUG |
| 389 // Outside the blink namespace for ease of invocation from gdb. | 387 // Outside the blink namespace for ease of invocation from gdb. |
| 390 void PLATFORM_EXPORT showGraphicsLayerTree(const blink::GraphicsLayer*); | 388 void PLATFORM_EXPORT showGraphicsLayerTree(const blink::GraphicsLayer*); |
| 391 #endif | 389 #endif |
| 392 | 390 |
| 393 #endif // GraphicsLayer_h | 391 #endif // GraphicsLayer_h |
| OLD | NEW |