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

Side by Side Diff: cc/layer.h

Issue 11418117: cc: Increment the ref count when assigning the SkImageFilter (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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
OLDNEW
1 // Copyright 2010 The Chromium Authors. All rights reserved. 1 // Copyright 2010 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 CC_LAYER_H_ 5 #ifndef CC_LAYER_H_
6 #define CC_LAYER_H_ 6 #define CC_LAYER_H_
7 7
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "cc/cc_export.h" 9 #include "cc/cc_export.h"
10 #include "cc/layer_animation_controller.h" 10 #include "cc/layer_animation_controller.h"
11 #include "cc/occlusion_tracker.h" 11 #include "cc/occlusion_tracker.h"
12 #include "cc/region.h" 12 #include "cc/region.h"
13 #include "cc/render_surface.h" 13 #include "cc/render_surface.h"
14 #include "third_party/skia/include/core/SkColor.h" 14 #include "third_party/skia/include/core/SkColor.h"
15 #include "third_party/skia/include/core/SkImageFilter.h"
16 #include "third_party/skia/include/core/SkRefCnt.h"
15 #include "ui/gfx/rect.h" 17 #include "ui/gfx/rect.h"
16 #include "ui/gfx/rect_f.h" 18 #include "ui/gfx/rect_f.h"
17 #include <public/WebFilterOperations.h> 19 #include <public/WebFilterOperations.h>
18 #include <public/WebTransformationMatrix.h> 20 #include <public/WebTransformationMatrix.h>
19 #include <string> 21 #include <string>
20 #include <vector> 22 #include <vector>
21 23
22 namespace WebKit { 24 namespace WebKit {
23 class WebAnimationDelegate; 25 class WebAnimationDelegate;
24 class WebLayerScrollClient; 26 class WebLayerScrollClient;
25 } 27 }
26 28
27 class SkImageFilter;
28
29 namespace cc { 29 namespace cc {
30 30
31 class ActiveAnimation; 31 class ActiveAnimation;
32 struct AnimationEvent; 32 struct AnimationEvent;
33 class LayerAnimationDelegate; 33 class LayerAnimationDelegate;
34 class LayerImpl; 34 class LayerImpl;
35 class LayerTreeHost; 35 class LayerTreeHost;
36 class PriorityCalculator; 36 class PriorityCalculator;
37 class ResourceUpdateQueue; 37 class ResourceUpdateQueue;
38 class ScrollbarLayer; 38 class ScrollbarLayer;
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 virtual void setNeedsDisplayRect(const gfx::RectF& dirtyRect); 94 virtual void setNeedsDisplayRect(const gfx::RectF& dirtyRect);
95 void setNeedsDisplay() { setNeedsDisplayRect(gfx::RectF(gfx::PointF(), bound s())); } 95 void setNeedsDisplay() { setNeedsDisplayRect(gfx::RectF(gfx::PointF(), bound s())); }
96 virtual bool needsDisplay() const; 96 virtual bool needsDisplay() const;
97 97
98 void setOpacity(float); 98 void setOpacity(float);
99 bool opacityIsAnimating() const; 99 bool opacityIsAnimating() const;
100 100
101 void setFilters(const WebKit::WebFilterOperations&); 101 void setFilters(const WebKit::WebFilterOperations&);
102 const WebKit::WebFilterOperations& filters() const { return m_filters; } 102 const WebKit::WebFilterOperations& filters() const { return m_filters; }
103 103
104 void setFilter(SkImageFilter* filter); 104 void setFilter(const SkRefPtr<SkImageFilter>& filter);
105 SkImageFilter* filter() const { return m_filter; } 105 SkRefPtr<SkImageFilter> filter() const { return m_filter; }
106 106
107 // Background filters are filters applied to what is behind this layer, when they are viewed through non-opaque 107 // Background filters are filters applied to what is behind this layer, when they are viewed through non-opaque
108 // regions in this layer. They are used through the WebLayer interface, and are not exposed to HTML. 108 // regions in this layer. They are used through the WebLayer interface, and are not exposed to HTML.
109 void setBackgroundFilters(const WebKit::WebFilterOperations&); 109 void setBackgroundFilters(const WebKit::WebFilterOperations&);
110 const WebKit::WebFilterOperations& backgroundFilters() const { return m_back groundFilters; } 110 const WebKit::WebFilterOperations& backgroundFilters() const { return m_back groundFilters; }
111 111
112 virtual void setContentsOpaque(bool); 112 virtual void setContentsOpaque(bool);
113 bool contentsOpaque() const { return m_contentsOpaque; } 113 bool contentsOpaque() const { return m_contentsOpaque; }
114 114
115 void setPosition(const gfx::PointF&); 115 void setPosition(const gfx::PointF&);
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 bool m_haveWheelEventHandlers; 356 bool m_haveWheelEventHandlers;
357 Region m_nonFastScrollableRegion; 357 Region m_nonFastScrollableRegion;
358 bool m_nonFastScrollableRegionChanged; 358 bool m_nonFastScrollableRegionChanged;
359 Region m_touchEventHandlerRegion; 359 Region m_touchEventHandlerRegion;
360 bool m_touchEventHandlerRegionChanged; 360 bool m_touchEventHandlerRegionChanged;
361 gfx::PointF m_position; 361 gfx::PointF m_position;
362 gfx::PointF m_anchorPoint; 362 gfx::PointF m_anchorPoint;
363 SkColor m_backgroundColor; 363 SkColor m_backgroundColor;
364 std::string m_debugName; 364 std::string m_debugName;
365 float m_opacity; 365 float m_opacity;
366 SkImageFilter* m_filter; 366 SkRefPtr<SkImageFilter> m_filter;
367 WebKit::WebFilterOperations m_filters; 367 WebKit::WebFilterOperations m_filters;
368 WebKit::WebFilterOperations m_backgroundFilters; 368 WebKit::WebFilterOperations m_backgroundFilters;
369 float m_anchorPointZ; 369 float m_anchorPointZ;
370 bool m_isContainerForFixedPositionLayers; 370 bool m_isContainerForFixedPositionLayers;
371 bool m_fixedToContainerLayer; 371 bool m_fixedToContainerLayer;
372 bool m_isDrawable; 372 bool m_isDrawable;
373 bool m_masksToBounds; 373 bool m_masksToBounds;
374 bool m_contentsOpaque; 374 bool m_contentsOpaque;
375 bool m_doubleSided; 375 bool m_doubleSided;
376 bool m_useLCDText; 376 bool m_useLCDText;
(...skipping 30 matching lines...) Expand all
407 407
408 WebKit::WebAnimationDelegate* m_layerAnimationDelegate; 408 WebKit::WebAnimationDelegate* m_layerAnimationDelegate;
409 WebKit::WebLayerScrollClient* m_layerScrollClient; 409 WebKit::WebLayerScrollClient* m_layerScrollClient;
410 }; 410 };
411 411
412 void sortLayers(std::vector<scoped_refptr<Layer> >::iterator, std::vector<scoped _refptr<Layer> >::iterator, void*); 412 void sortLayers(std::vector<scoped_refptr<Layer> >::iterator, std::vector<scoped _refptr<Layer> >::iterator, void*);
413 413
414 } // namespace cc 414 } // namespace cc
415 415
416 #endif // CC_LAYER_H_ 416 #endif // CC_LAYER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698