Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Side by Side Diff: cc/resources/layer_updater.h

Issue 1057283003: Remove parts of //cc we aren't using (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/resources/layer_tiling_data.cc ('k') | cc/resources/layer_updater.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2011 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_RESOURCES_LAYER_UPDATER_H_
6 #define CC_RESOURCES_LAYER_UPDATER_H_
7
8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "cc/base/cc_export.h"
11 #include "third_party/skia/include/core/SkColor.h"
12 #include "ui/gfx/geometry/rect.h"
13 #include "ui/gfx/geometry/vector2d.h"
14
15 namespace cc {
16
17 class PrioritizedResource;
18 class PrioritizedResourceManager;
19 class ResourceUpdateQueue;
20 class TextureManager;
21
22 class CC_EXPORT LayerUpdater : public base::RefCounted<LayerUpdater> {
23 public:
24 // Allows updaters to store per-resource update properties.
25 class CC_EXPORT Resource {
26 public:
27 virtual ~Resource();
28
29 PrioritizedResource* texture() { return texture_.get(); }
30 // TODO(reveman): partial_update should be a property of this class
31 // instead of an argument passed to Update().
32 virtual void Update(ResourceUpdateQueue* queue,
33 const gfx::Rect& source_rect,
34 const gfx::Vector2d& dest_offset,
35 bool partial_update) = 0;
36
37 protected:
38 explicit Resource(scoped_ptr<PrioritizedResource> texture);
39
40 private:
41 scoped_ptr<PrioritizedResource> texture_;
42
43 DISALLOW_COPY_AND_ASSIGN(Resource);
44 };
45
46 LayerUpdater() {}
47
48 virtual scoped_ptr<Resource> CreateResource(
49 PrioritizedResourceManager* manager) = 0;
50 virtual void PrepareToUpdate(const gfx::Size& content_size,
51 const gfx::Rect& paint_rect,
52 const gfx::Size& tile_size,
53 float contents_width_scale,
54 float contents_height_scale) {}
55 virtual void ReduceMemoryUsage() {}
56
57 // Set true by the layer when it is known that the entire output is going to
58 // be opaque.
59 virtual void SetOpaque(bool opaque) {}
60 // Set true by the layer when it is known that the entire output bounds will
61 // be rasterized.
62 virtual void SetFillsBoundsCompletely(bool fills_bounds) {}
63 virtual void SetBackgroundColor(SkColor background_color) {}
64
65 protected:
66 virtual ~LayerUpdater() {}
67
68 private:
69 friend class base::RefCounted<LayerUpdater>;
70
71 DISALLOW_COPY_AND_ASSIGN(LayerUpdater);
72 };
73
74 } // namespace cc
75
76 #endif // CC_RESOURCES_LAYER_UPDATER_H_
OLDNEW
« no previous file with comments | « cc/resources/layer_tiling_data.cc ('k') | cc/resources/layer_updater.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698