Revert "Reland c91b178b07b0d - Delete dead signin code (SigninGlobalError)"
[chromium-blink-merge.git] / cc / layers / picture_layer.h
blob771484c19cc9410b3160885e58481c19531ab866
1 // Copyright 2012 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.
5 #ifndef CC_LAYERS_PICTURE_LAYER_H_
6 #define CC_LAYERS_PICTURE_LAYER_H_
8 #include "cc/base/invalidation_region.h"
9 #include "cc/debug/devtools_instrumentation.h"
10 #include "cc/debug/micro_benchmark_controller.h"
11 #include "cc/layers/layer.h"
13 namespace cc {
15 class ContentLayerClient;
16 class RecordingSource;
17 class ResourceUpdateQueue;
19 class CC_EXPORT PictureLayer : public Layer {
20 public:
21 static scoped_refptr<PictureLayer> Create(const LayerSettings& settings,
22 ContentLayerClient* client);
24 void ClearClient();
26 void SetNearestNeighbor(bool nearest_neighbor);
28 // Layer interface.
29 scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override;
30 void SetLayerTreeHost(LayerTreeHost* host) override;
31 void PushPropertiesTo(LayerImpl* layer) override;
32 void SetNeedsDisplayRect(const gfx::Rect& layer_rect) override;
33 bool Update() override;
34 void SetIsMask(bool is_mask) override;
35 skia::RefPtr<SkPicture> GetPicture() const override;
36 bool IsSuitableForGpuRasterization() const override;
38 void RunMicroBenchmark(MicroBenchmark* benchmark) override;
40 ContentLayerClient* client() { return client_; }
42 RecordingSource* GetRecordingSourceForTesting() {
43 return recording_source_.get();
46 protected:
47 PictureLayer(const LayerSettings& settings, ContentLayerClient* client);
48 // Allow tests to inject a recording source.
49 PictureLayer(const LayerSettings& settings,
50 ContentLayerClient* client,
51 scoped_ptr<RecordingSource> source);
52 ~PictureLayer() override;
54 bool HasDrawableContent() const override;
56 bool is_mask() const { return is_mask_; }
58 private:
59 ContentLayerClient* client_;
60 scoped_ptr<RecordingSource> recording_source_;
61 devtools_instrumentation::
62 ScopedLayerObjectTracker instrumentation_object_tracker_;
63 // Invalidation to use the next time update is called.
64 InvalidationRegion pending_invalidation_;
65 // Invalidation from the last time update was called.
66 Region recording_invalidation_;
67 gfx::Rect last_updated_visible_layer_rect_;
69 int update_source_frame_number_;
70 bool is_mask_;
71 bool nearest_neighbor_;
73 DISALLOW_COPY_AND_ASSIGN(PictureLayer);
76 } // namespace cc
78 #endif // CC_LAYERS_PICTURE_LAYER_H_