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

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

Issue 9566036: Expose compositor filters on ui::Layer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: when blur radius is 0, remove the blur filter Created 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | ui/gfx/compositor/layer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_LAYER_H_ 5 #ifndef UI_GFX_COMPOSITOR_LAYER_H_
6 #define UI_GFX_COMPOSITOR_LAYER_H_ 6 #define UI_GFX_COMPOSITOR_LAYER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
13 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
14 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
15 #include "base/message_loop.h" 15 #include "base/message_loop.h"
16 #include "third_party/skia/include/core/SkColor.h" 16 #include "third_party/skia/include/core/SkColor.h"
17 #include "third_party/skia/include/core/SkRegion.h" 17 #include "third_party/skia/include/core/SkRegion.h"
18 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebContentLa yerClient.h" 18 #include "third_party/WebKit/Source/Platform/chromium/public/WebContentLayerClie nt.h"
19 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebLayer.h" 19 #include "third_party/WebKit/Source/Platform/chromium/public/WebLayer.h"
20 #include "ui/gfx/rect.h" 20 #include "ui/gfx/rect.h"
21 #include "ui/gfx/transform.h" 21 #include "ui/gfx/transform.h"
22 #include "ui/gfx/compositor/compositor.h" 22 #include "ui/gfx/compositor/compositor.h"
23 #include "ui/gfx/compositor/layer_animation_delegate.h" 23 #include "ui/gfx/compositor/layer_animation_delegate.h"
24 #include "ui/gfx/compositor/layer_delegate.h" 24 #include "ui/gfx/compositor/layer_delegate.h"
25 #include "ui/gfx/compositor/layer_type.h" 25 #include "ui/gfx/compositor/layer_type.h"
26 26
27 class SkCanvas; 27 class SkCanvas;
28 28
29 namespace ui { 29 namespace ui {
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 // Sets/gets whether or not drawing of child layers should be clipped to the 120 // Sets/gets whether or not drawing of child layers should be clipped to the
121 // bounds of this layer. 121 // bounds of this layer.
122 void SetMasksToBounds(bool masks_to_bounds); 122 void SetMasksToBounds(bool masks_to_bounds);
123 bool GetMasksToBounds() const; 123 bool GetMasksToBounds() const;
124 124
125 // The opacity of the layer. The opacity is applied to each pixel of the 125 // The opacity of the layer. The opacity is applied to each pixel of the
126 // texture (resulting alpha = opacity * alpha). 126 // texture (resulting alpha = opacity * alpha).
127 float opacity() const { return opacity_; } 127 float opacity() const { return opacity_; }
128 void SetOpacity(float opacity); 128 void SetOpacity(float opacity);
129 129
130 // Blur pixels by this amount in anything below the layer and visible through
131 // the layer.
132 int background_blur() const { return background_blur_radius_; }
133 void SetBackgroundBlur(int blur_radius);
134
130 // Return the target opacity if animator is running, or the current opacity 135 // Return the target opacity if animator is running, or the current opacity
131 // otherwise. 136 // otherwise.
132 float GetTargetOpacity() const; 137 float GetTargetOpacity() const;
133 138
134 // Sets the visibility of the Layer. A Layer may be visible but not 139 // Sets the visibility of the Layer. A Layer may be visible but not
135 // drawn. This happens if any ancestor of a Layer is not visible. 140 // drawn. This happens if any ancestor of a Layer is not visible.
136 void SetVisible(bool visible); 141 void SetVisible(bool visible);
137 bool visible() const { return visible_; } 142 bool visible() const { return visible_; }
138 143
139 // Returns the target visibility if the animator is running. Otherwise, it 144 // Returns the target visibility if the animator is running. Otherwise, it
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 bool fills_bounds_opaquely_; 274 bool fills_bounds_opaquely_;
270 275
271 // If true the layer is always up to date. 276 // If true the layer is always up to date.
272 bool layer_updated_externally_; 277 bool layer_updated_externally_;
273 278
274 // Union of damaged rects to be used when compositor is ready to 279 // Union of damaged rects to be used when compositor is ready to
275 // paint the content. 280 // paint the content.
276 SkRegion damaged_region_; 281 SkRegion damaged_region_;
277 282
278 float opacity_; 283 float opacity_;
284 int background_blur_radius_;
279 285
280 std::string name_; 286 std::string name_;
281 287
282 LayerDelegate* delegate_; 288 LayerDelegate* delegate_;
283 289
284 scoped_ptr<LayerAnimator> animator_; 290 scoped_ptr<LayerAnimator> animator_;
285 291
286 WebKit::WebLayer web_layer_; 292 WebKit::WebLayer web_layer_;
287 bool web_layer_is_accelerated_; 293 bool web_layer_is_accelerated_;
288 bool show_debug_borders_; 294 bool show_debug_borders_;
289 295
290 DISALLOW_COPY_AND_ASSIGN(Layer); 296 DISALLOW_COPY_AND_ASSIGN(Layer);
291 }; 297 };
292 298
293 } // namespace ui 299 } // namespace ui
294 300
295 #endif // UI_GFX_COMPOSITOR_LAYER_H_ 301 #endif // UI_GFX_COMPOSITOR_LAYER_H_
OLDNEW
« no previous file with comments | « no previous file | ui/gfx/compositor/layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698