| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 #include "public/platform/WebImageLayer.h" | 50 #include "public/platform/WebImageLayer.h" |
| 51 #include "public/platform/WebLayerScrollClient.h" | 51 #include "public/platform/WebLayerScrollClient.h" |
| 52 #include "third_party/skia/include/core/SkPaint.h" | 52 #include "third_party/skia/include/core/SkPaint.h" |
| 53 #include "wtf/OwnPtr.h" | 53 #include "wtf/OwnPtr.h" |
| 54 #include "wtf/PassOwnPtr.h" | 54 #include "wtf/PassOwnPtr.h" |
| 55 #include "wtf/Vector.h" | 55 #include "wtf/Vector.h" |
| 56 | 56 |
| 57 namespace blink { | 57 namespace blink { |
| 58 | 58 |
| 59 class FloatRect; | 59 class FloatRect; |
| 60 class GraphicsLayerFactory; | |
| 61 class GraphicsLayerFactoryChromium; | |
| 62 class Image; | 60 class Image; |
| 63 class LinkHighlight; | 61 class LinkHighlight; |
| 64 class JSONObject; | 62 class JSONObject; |
| 65 class PaintController; | 63 class PaintController; |
| 66 class ScrollableArea; | 64 class ScrollableArea; |
| 67 class WebLayer; | 65 class WebLayer; |
| 68 | 66 |
| 69 typedef Vector<GraphicsLayer*, 64> GraphicsLayerVector; | 67 typedef Vector<GraphicsLayer*, 64> GraphicsLayerVector; |
| 70 | 68 |
| 71 // GraphicsLayer is an abstraction for a rendering surface with backing store, | 69 // GraphicsLayer is an abstraction for a rendering surface with backing store, |
| 72 // which may have associated transformation and animations. | 70 // which may have associated transformation and animations. |
| 73 | 71 |
| 74 class PLATFORM_EXPORT GraphicsLayer : public WebLayerScrollClient, public cc::La
yerClient, public DisplayItemClient { | 72 class PLATFORM_EXPORT GraphicsLayer : public WebLayerScrollClient, public cc::La
yerClient, public DisplayItemClient { |
| 75 WTF_MAKE_NONCOPYABLE(GraphicsLayer); USING_FAST_MALLOC(GraphicsLayer); | 73 WTF_MAKE_NONCOPYABLE(GraphicsLayer); USING_FAST_MALLOC(GraphicsLayer); |
| 76 public: | 74 public: |
| 77 static PassOwnPtr<GraphicsLayer> create(GraphicsLayerFactory*, GraphicsLayer
Client*); | 75 static PassOwnPtr<GraphicsLayer> create(GraphicsLayerClient*); |
| 78 | 76 |
| 79 ~GraphicsLayer() override; | 77 ~GraphicsLayer() override; |
| 80 | 78 |
| 81 GraphicsLayerClient* client() const { return m_client; } | 79 GraphicsLayerClient* client() const { return m_client; } |
| 82 | 80 |
| 83 GraphicsLayerDebugInfo& debugInfo(); | 81 GraphicsLayerDebugInfo& debugInfo(); |
| 84 | 82 |
| 85 void setCompositingReasons(CompositingReasons); | 83 void setCompositingReasons(CompositingReasons); |
| 86 CompositingReasons getCompositingReasons() const { return m_debugInfo.getCom
positingReasons(); } | 84 CompositingReasons getCompositingReasons() const { return m_debugInfo.getCom
positingReasons(); } |
| 87 void setSquashingDisallowedReasons(SquashingDisallowedReasons); | 85 void setSquashingDisallowedReasons(SquashingDisallowedReasons); |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 | 249 |
| 252 // DisplayItemClient methods | 250 // DisplayItemClient methods |
| 253 String debugName() const final { return m_client->debugName(this); } | 251 String debugName() const final { return m_client->debugName(this); } |
| 254 LayoutRect visualRect() const override; | 252 LayoutRect visualRect() const override; |
| 255 | 253 |
| 256 protected: | 254 protected: |
| 257 String debugName(cc::Layer*) const; | 255 String debugName(cc::Layer*) const; |
| 258 bool shouldFlattenTransform() const { return m_shouldFlattenTransform; } | 256 bool shouldFlattenTransform() const { return m_shouldFlattenTransform; } |
| 259 | 257 |
| 260 explicit GraphicsLayer(GraphicsLayerClient*); | 258 explicit GraphicsLayer(GraphicsLayerClient*); |
| 261 // GraphicsLayerFactoryChromium that wants to create a GraphicsLayer need to
be friends. | |
| 262 friend class GraphicsLayerFactoryChromium; | |
| 263 // for testing | 259 // for testing |
| 264 friend class CompositedLayerMappingTest; | 260 friend class CompositedLayerMappingTest; |
| 265 friend class FakeGraphicsLayerFactory; | |
| 266 friend class PaintControllerPaintTestBase; | 261 friend class PaintControllerPaintTestBase; |
| 267 | 262 |
| 268 private: | 263 private: |
| 269 // Returns true if PaintController::paintArtifact() changed and needs commit
. | 264 // Returns true if PaintController::paintArtifact() changed and needs commit
. |
| 270 bool paintWithoutCommit(const IntRect* interestRect, GraphicsContext::Disabl
edMode = GraphicsContext::NothingDisabled); | 265 bool paintWithoutCommit(const IntRect* interestRect, GraphicsContext::Disabl
edMode = GraphicsContext::NothingDisabled); |
| 271 | 266 |
| 272 // Adds a child without calling updateChildList(), so that adding children | 267 // Adds a child without calling updateChildList(), so that adding children |
| 273 // can be batched before updating. | 268 // can be batched before updating. |
| 274 void addChildInternal(GraphicsLayer*); | 269 void addChildInternal(GraphicsLayer*); |
| 275 | 270 |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 }; | 362 }; |
| 368 | 363 |
| 369 } // namespace blink | 364 } // namespace blink |
| 370 | 365 |
| 371 #ifndef NDEBUG | 366 #ifndef NDEBUG |
| 372 // Outside the blink namespace for ease of invocation from gdb. | 367 // Outside the blink namespace for ease of invocation from gdb. |
| 373 void PLATFORM_EXPORT showGraphicsLayerTree(const blink::GraphicsLayer*); | 368 void PLATFORM_EXPORT showGraphicsLayerTree(const blink::GraphicsLayer*); |
| 374 #endif | 369 #endif |
| 375 | 370 |
| 376 #endif // GraphicsLayer_h | 371 #endif // GraphicsLayer_h |
| OLD | NEW |