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

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

Issue 8561016: Adds a bounds parameter to ui::Compositor::ReadPixels (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nicer revision Created 9 years, 1 month 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
« no previous file with comments | « no previous file | ui/gfx/compositor/compositor_cc.h » ('j') | ui/gfx/compositor/compositor_gl.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 // The Compositor does not own the root layer. 129 // The Compositor does not own the root layer.
130 const Layer* root_layer() const { return root_layer_; } 130 const Layer* root_layer() const { return root_layer_; }
131 Layer* root_layer() { return root_layer_; } 131 Layer* root_layer() { return root_layer_; }
132 void SetRootLayer(Layer* root_layer); 132 void SetRootLayer(Layer* root_layer);
133 133
134 // Draws the scene created by the layer tree and any visual effects. If 134 // Draws the scene created by the layer tree and any visual effects. If
135 // |force_clear| is true, this will cause the compositor to clear before 135 // |force_clear| is true, this will cause the compositor to clear before
136 // compositing. 136 // compositing.
137 void Draw(bool force_clear); 137 void Draw(bool force_clear);
138 138
139 // Reads the contents of the last rendered frame into the given bitmap. 139 // Reads the region |bounds| of the contents of the last rendered frame
140 // into the given bitmap.
140 // Returns false if the pixels could not be read. 141 // Returns false if the pixels could not be read.
141 virtual bool ReadPixels(SkBitmap* bitmap) = 0; 142 virtual bool ReadPixels(SkBitmap* bitmap, const gfx::Rect& bounds) = 0;
142 143
143 // Notifies the compositor that the size of the widget that it is 144 // Notifies the compositor that the size of the widget that it is
144 // drawing to has changed. 145 // drawing to has changed.
145 void WidgetSizeChanged(const gfx::Size& size) { 146 void WidgetSizeChanged(const gfx::Size& size) {
146 if (size.IsEmpty()) 147 if (size.IsEmpty())
147 return; 148 return;
148 size_ = size; 149 size_ = size;
149 OnWidgetSizeChanged(); 150 OnWidgetSizeChanged();
150 } 151 }
151 152
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 // calls to it. 211 // calls to it.
211 static ui::Compositor*(*compositor_factory_)( 212 static ui::Compositor*(*compositor_factory_)(
212 ui::CompositorDelegate* delegate); 213 ui::CompositorDelegate* delegate);
213 214
214 friend class base::RefCounted<Compositor>; 215 friend class base::RefCounted<Compositor>;
215 }; 216 };
216 217
217 } // namespace ui 218 } // namespace ui
218 219
219 #endif // UI_GFX_COMPOSITOR_COMPOSITOR_H_ 220 #endif // UI_GFX_COMPOSITOR_COMPOSITOR_H_
OLDNEW
« no previous file with comments | « no previous file | ui/gfx/compositor/compositor_cc.h » ('j') | ui/gfx/compositor/compositor_gl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698