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

Side by Side Diff: ui/gfx/compositor/compositor.h

Issue 8222028: Use WebKit compositor in ui::Layer (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: rebase,fixes Created 9 years, 2 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_GFX_COMPOSITOR_COMPOSITOR_H_ 5 #ifndef UI_GFX_COMPOSITOR_COMPOSITOR_H_
6 #define UI_GFX_COMPOSITOR_COMPOSITOR_H_ 6 #define UI_GFX_COMPOSITOR_COMPOSITOR_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/observer_list.h" 10 #include "base/observer_list.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 gfx::AcceleratedWidget widget, 100 gfx::AcceleratedWidget widget,
101 const gfx::Size& size); 101 const gfx::Size& size);
102 102
103 // Creates a new texture. The caller owns the returned object. 103 // Creates a new texture. The caller owns the returned object.
104 virtual Texture* CreateTexture() = 0; 104 virtual Texture* CreateTexture() = 0;
105 105
106 // Blurs the specific region in the compositor. 106 // Blurs the specific region in the compositor.
107 virtual void Blur(const gfx::Rect& bounds) = 0; 107 virtual void Blur(const gfx::Rect& bounds) = 0;
108 108
109 // Schedules a redraw of the layer tree associated with this compositor. 109 // Schedules a redraw of the layer tree associated with this compositor.
110 void ScheduleDraw() { 110 virtual void ScheduleDraw() {
Ben Goodger (Google) 2011/10/16 22:39:51 this probably shouldn't be inlined anymore
piman 2011/10/19 17:53:23 Done.
111 delegate_->ScheduleDraw(); 111 delegate_->ScheduleDraw();
112 } 112 }
113 113
114 // Sets the root of the layer tree drawn by this Compositor. 114 // Sets the root of the layer tree drawn by this Compositor.
115 // The Compositor does not own the root layer. 115 // The Compositor does not own the root layer.
116 Layer* root_layer() { return root_layer_; } 116 Layer* root_layer() { return root_layer_; }
117 void SetRootLayer(Layer* root_layer); 117 void SetRootLayer(Layer* root_layer);
118 118
119 // Draws the scene created by the layer tree and any visual effects. If 119 // Draws the scene created by the layer tree and any visual effects. If
120 // |force_clear| is true, this will cause the compositor to clear before 120 // |force_clear| is true, this will cause the compositor to clear before
(...skipping 22 matching lines...) Expand all
143 Compositor(CompositorDelegate* delegate, const gfx::Size& size); 143 Compositor(CompositorDelegate* delegate, const gfx::Size& size);
144 virtual ~Compositor(); 144 virtual ~Compositor();
145 145
146 // Notifies the compositor that compositing is about to start. 146 // Notifies the compositor that compositing is about to start.
147 virtual void OnNotifyStart(bool clear) = 0; 147 virtual void OnNotifyStart(bool clear) = 0;
148 148
149 // Notifies the compositor that compositing is complete. 149 // Notifies the compositor that compositing is complete.
150 virtual void OnNotifyEnd() = 0; 150 virtual void OnNotifyEnd() = 0;
151 151
152 virtual void OnWidgetSizeChanged() = 0; 152 virtual void OnWidgetSizeChanged() = 0;
153 virtual void OnRootLayerChanged();
154 virtual void DrawTree();
153 155
154 CompositorDelegate* delegate() { return delegate_; } 156 CompositorDelegate* delegate() { return delegate_; }
155 157
156 private: 158 private:
157 // Notifies the compositor that compositing is about to start. See Draw() for 159 // Notifies the compositor that compositing is about to start. See Draw() for
158 // notes about |force_clear|. 160 // notes about |force_clear|.
159 void NotifyStart(bool force_clear); 161 void NotifyStart(bool force_clear);
160 162
161 // Notifies the compositor that compositing is complete. 163 // Notifies the compositor that compositing is complete.
162 void NotifyEnd(); 164 void NotifyEnd();
163 165
164 CompositorDelegate* delegate_; 166 CompositorDelegate* delegate_;
165 gfx::Size size_; 167 gfx::Size size_;
166 168
167 // The root of the Layer tree drawn by this compositor. 169 // The root of the Layer tree drawn by this compositor.
168 Layer* root_layer_; 170 Layer* root_layer_;
169 171
170 ObserverList<CompositorObserver> observer_list_; 172 ObserverList<CompositorObserver> observer_list_;
171 173
172 friend class base::RefCounted<Compositor>; 174 friend class base::RefCounted<Compositor>;
173 }; 175 };
174 176
175 } // namespace ui 177 } // namespace ui
176 178
177 #endif // UI_GFX_COMPOSITOR_COMPOSITOR_H_ 179 #endif // UI_GFX_COMPOSITOR_COMPOSITOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698