OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CC_LAYERS_EMPTY_CONTENT_LAYER_CLIENT_H_ |
| 6 #define CC_LAYERS_EMPTY_CONTENT_LAYER_CLIENT_H_ |
| 7 |
| 8 #include "base/lazy_instance.h" |
| 9 #include "base/macros.h" |
| 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "cc/base/cc_export.h" |
| 12 #include "cc/layers/content_layer_client.h" |
| 13 #include "ui/gfx/geometry/rect.h" |
| 14 |
| 15 namespace cc { |
| 16 |
| 17 class DisplayItemList; |
| 18 |
| 19 // This is used by deserialized PictureLayers which have no local |
| 20 // ContentLayerClient but still have valid content from the original serialized |
| 21 // PictureLayer. The PictureLayer class requires a valid ContentLayerClient to |
| 22 // determine if it can draw. This is a dummy client to keep the logic fairly |
| 23 // straightforward. This is also used by unit tests for creating dummy |
| 24 // PictureLayers. |
| 25 class CC_EXPORT EmptyContentLayerClient : public ContentLayerClient { |
| 26 public: |
| 27 static ContentLayerClient* GetInstance(); |
| 28 |
| 29 // ContentLayerClient implementation. |
| 30 gfx::Rect PaintableRegion() override; |
| 31 scoped_refptr<DisplayItemList> PaintContentsToDisplayList( |
| 32 PaintingControlSetting painting_status) override; |
| 33 bool FillsBoundsCompletely() const override; |
| 34 size_t GetApproximateUnsharedMemoryUsage() const override; |
| 35 |
| 36 private: |
| 37 friend struct base::DefaultLazyInstanceTraits<EmptyContentLayerClient>; |
| 38 |
| 39 EmptyContentLayerClient(); |
| 40 ~EmptyContentLayerClient() override; |
| 41 |
| 42 DISALLOW_COPY_AND_ASSIGN(EmptyContentLayerClient); |
| 43 }; |
| 44 |
| 45 } // namespace cc |
| 46 |
| 47 #endif // CC_LAYERS_EMPTY_CONTENT_LAYER_CLIENT_H_ |
OLD | NEW |