Chromium Code Reviews| 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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 174 void setFilters(const FilterOperations&); | 174 void setFilters(const FilterOperations&); |
| 175 void setBackdropFilters(const FilterOperations&); | 175 void setBackdropFilters(const FilterOperations&); |
| 176 | 176 |
| 177 void setFilterQuality(SkFilterQuality); | 177 void setFilterQuality(SkFilterQuality); |
| 178 | 178 |
| 179 // Some GraphicsLayers paint only the foreground or the background content | 179 // Some GraphicsLayers paint only the foreground or the background content |
| 180 void setPaintingPhase(GraphicsLayerPaintingPhase); | 180 void setPaintingPhase(GraphicsLayerPaintingPhase); |
| 181 | 181 |
| 182 void setNeedsDisplay(); | 182 void setNeedsDisplay(); |
| 183 // Mark the given rect (in layer coords) as needing display. Never goes deep . | 183 // Mark the given rect (in layer coords) as needing display. Never goes deep . |
| 184 void setNeedsDisplayInRect(const IntRect&, PaintInvalidationReason); | 184 void setNeedsDisplayInRect(const IntRect&, PaintInvalidationReason, const Di splayItemClient&); |
| 185 | 185 |
| 186 void setContentsNeedsDisplay(); | 186 void setContentsNeedsDisplay(); |
| 187 | 187 |
| 188 void invalidateDisplayItemClient(const DisplayItemClient&, PaintInvalidation Reason); | 188 void invalidateDisplayItemClient(const DisplayItemClient&, PaintInvalidation Reason); |
| 189 | 189 |
| 190 // Set that the position/size of the contents (image or video). | 190 // Set that the position/size of the contents (image or video). |
| 191 void setContentsRect(const IntRect&); | 191 void setContentsRect(const IntRect&); |
| 192 | 192 |
| 193 // Layer contents | 193 // Layer contents |
| 194 void setContentsToImage(Image*, RespectImageOrientationEnum = DoNotRespectIm ageOrientation); | 194 void setContentsToImage(Image*, RespectImageOrientationEnum = DoNotRespectIm ageOrientation); |
| 195 void setContentsToPlatformLayer(WebLayer* layer) { setContentsTo(layer); } | 195 void setContentsToPlatformLayer(WebLayer* layer) { setContentsTo(layer); } |
| 196 bool hasContentsLayer() const { return m_contentsLayer; } | 196 bool hasContentsLayer() const { return m_contentsLayer; } |
| 197 | 197 |
| 198 // For hosting this GraphicsLayer in a native layer hierarchy. | 198 // For hosting this GraphicsLayer in a native layer hierarchy. |
| 199 WebLayer* platformLayer() const; | 199 WebLayer* platformLayer() const; |
| 200 | 200 |
| 201 typedef HashMap<int, int> RenderingContextMap; | 201 typedef HashMap<int, int> RenderingContextMap; |
| 202 PassRefPtr<JSONObject> layerTreeAsJSON(LayerTreeFlags, RenderingContextMap&) const; | 202 PassRefPtr<JSONObject> layerTreeAsJSON(LayerTreeFlags, RenderingContextMap&) const; |
| 203 | 203 |
| 204 int paintCount() const { return m_paintCount; } | 204 int paintCount() const { return m_paintCount; } |
| 205 | 205 |
| 206 // Return a string with a human readable form of the layer tree, If debug is true | 206 // Return a string with a human readable form of the layer tree, If debug is true |
| 207 // pointers for the layers and timing data will be included in the returned string. | 207 // pointers for the layers and timing data will be included in the returned string. |
| 208 String layerTreeAsText(LayerTreeFlags = LayerTreeNormal) const; | 208 String layerTreeAsText(LayerTreeFlags = LayerTreeNormal) const; |
| 209 | 209 |
| 210 bool isTrackingPaintInvalidations() const { return m_client->isTrackingPaint Invalidations(); } | 210 bool isTrackingPaintInvalidations() const { return m_client->isTrackingPaint Invalidations(); } |
| 211 void resetTrackedPaintInvalidations(); | 211 void resetTrackedPaintInvalidations(); |
| 212 bool hasTrackedPaintInvalidations() const; | 212 bool hasTrackedPaintInvalidations() const; |
| 213 void trackPaintInvalidationRect(const FloatRect&); | 213 void trackPaintInvalidation(const String& objectDebugName, const FloatRect&, const char* reason); |
| 214 void trackPaintInvalidationObject(const String&); | |
| 215 | 214 |
| 216 void addLinkHighlight(LinkHighlight*); | 215 void addLinkHighlight(LinkHighlight*); |
| 217 void removeLinkHighlight(LinkHighlight*); | 216 void removeLinkHighlight(LinkHighlight*); |
| 218 // Exposed for tests | 217 // Exposed for tests |
| 219 unsigned numLinkHighlights() { return m_linkHighlights.size(); } | 218 unsigned numLinkHighlights() { return m_linkHighlights.size(); } |
| 220 LinkHighlight* getLinkHighlight(int i) { return m_linkHighlights[i]; } | 219 LinkHighlight* getLinkHighlight(int i) { return m_linkHighlights[i]; } |
| 221 | 220 |
| 222 void setScrollableArea(ScrollableArea*, bool isViewport); | 221 void setScrollableArea(ScrollableArea*, bool isViewport); |
| 223 ScrollableArea* getScrollableArea() const { return m_scrollableArea; } | 222 ScrollableArea* getScrollableArea() const { return m_scrollableArea; } |
| 224 | 223 |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 352 | 351 |
| 353 OwnPtr<ContentLayerDelegate> m_contentLayerDelegate; | 352 OwnPtr<ContentLayerDelegate> m_contentLayerDelegate; |
| 354 | 353 |
| 355 WeakPersistent<ScrollableArea> m_scrollableArea; | 354 WeakPersistent<ScrollableArea> m_scrollableArea; |
| 356 GraphicsLayerDebugInfo m_debugInfo; | 355 GraphicsLayerDebugInfo m_debugInfo; |
| 357 int m_3dRenderingContext; | 356 int m_3dRenderingContext; |
| 358 | 357 |
| 359 OwnPtr<PaintController> m_paintController; | 358 OwnPtr<PaintController> m_paintController; |
| 360 | 359 |
| 361 IntRect m_previousInterestRect; | 360 IntRect m_previousInterestRect; |
| 361 | |
| 362 // Used when tracking paint invalidation, to avoid duplicate DisplayItemClie nt invalidation entries. | |
| 363 const DisplayItemClient* m_lastSetNeedsDisplayInRectDisplayItemClient; | |
|
pdr.
2016/04/12 00:20:06
It doesn't seem right to add debug-only members to
Xianzhu
2016/04/12 01:14:26
Found a better way to handle this.
| |
| 362 }; | 364 }; |
| 363 | 365 |
| 364 } // namespace blink | 366 } // namespace blink |
| 365 | 367 |
| 366 #ifndef NDEBUG | 368 #ifndef NDEBUG |
| 367 // Outside the blink namespace for ease of invocation from gdb. | 369 // Outside the blink namespace for ease of invocation from gdb. |
| 368 void PLATFORM_EXPORT showGraphicsLayerTree(const blink::GraphicsLayer*); | 370 void PLATFORM_EXPORT showGraphicsLayerTree(const blink::GraphicsLayer*); |
| 369 #endif | 371 #endif |
| 370 | 372 |
| 371 #endif // GraphicsLayer_h | 373 #endif // GraphicsLayer_h |
| OLD | NEW |