| 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 <memory> | |
| 9 | |
| 10 #include "base/lazy_instance.h" | |
| 11 #include "base/macros.h" | |
| 12 #include "cc/base/cc_export.h" | |
| 13 #include "cc/layers/content_layer_client.h" | |
| 14 #include "ui/gfx/geometry/rect.h" | |
| 15 | |
| 16 namespace cc { | |
| 17 | |
| 18 class DisplayItemList; | |
| 19 | |
| 20 // This is used by deserialized PictureLayers which have no local | |
| 21 // ContentLayerClient but still have valid content from the original serialized | |
| 22 // PictureLayer. The PictureLayer class requires a valid ContentLayerClient to | |
| 23 // determine if it can draw. This is a dummy client to keep the logic fairly | |
| 24 // straightforward. This is also used by unit tests for creating dummy | |
| 25 // PictureLayers. | |
| 26 class CC_EXPORT EmptyContentLayerClient : public ContentLayerClient { | |
| 27 public: | |
| 28 static ContentLayerClient* GetInstance(); | |
| 29 | |
| 30 // ContentLayerClient implementation. | |
| 31 gfx::Rect PaintableRegion() override; | |
| 32 scoped_refptr<DisplayItemList> PaintContentsToDisplayList( | |
| 33 PaintingControlSetting painting_status) override; | |
| 34 bool FillsBoundsCompletely() const override; | |
| 35 size_t GetApproximateUnsharedMemoryUsage() const override; | |
| 36 | |
| 37 private: | |
| 38 friend struct base::LazyInstanceTraitsBase<EmptyContentLayerClient>; | |
| 39 | |
| 40 EmptyContentLayerClient(); | |
| 41 ~EmptyContentLayerClient() override; | |
| 42 | |
| 43 DISALLOW_COPY_AND_ASSIGN(EmptyContentLayerClient); | |
| 44 }; | |
| 45 | |
| 46 } // namespace cc | |
| 47 | |
| 48 #endif // CC_LAYERS_EMPTY_CONTENT_LAYER_CLIENT_H_ | |
| OLD | NEW |