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

Side by Side Diff: cc/layer_impl.cc

Issue 11175009: Implement SkImageFilter support in the compositor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add TODOs; comment out OVERRIDE. Created 8 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 2011 The Chromium Authors. All rights reserved. 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 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 #include "config.h" 5 #include "config.h"
6 6
7 #include "CCLayerImpl.h" 7 #include "CCLayerImpl.h"
8 8
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/stringprintf.h" 10 #include "base/stringprintf.h"
11 #include "CCDebugBorderDrawQuad.h" 11 #include "CCDebugBorderDrawQuad.h"
12 #include "CCLayerSorter.h" 12 #include "CCLayerSorter.h"
13 #include "CCMathUtil.h" 13 #include "CCMathUtil.h"
14 #include "CCProxy.h" 14 #include "CCProxy.h"
15 #include "CCQuadSink.h" 15 #include "CCQuadSink.h"
16 #include "CCScrollbarAnimationController.h" 16 #include "CCScrollbarAnimationController.h"
17 #include "CCSettings.h" 17 #include "CCSettings.h"
18 #include "SkImageFilter.h"
18 19
19 using WebKit::WebTransformationMatrix; 20 using WebKit::WebTransformationMatrix;
20 21
21 namespace cc { 22 namespace cc {
22 23
23 CCLayerImpl::CCLayerImpl(int id) 24 CCLayerImpl::CCLayerImpl(int id)
24 : m_parent(0) 25 : m_parent(0)
25 , m_maskLayerId(-1) 26 , m_maskLayerId(-1)
26 , m_replicaLayerId(-1) 27 , m_replicaLayerId(-1)
27 , m_layerId(id) 28 , m_layerId(id)
(...skipping 17 matching lines...) Expand all
45 , m_drawsContent(false) 46 , m_drawsContent(false)
46 , m_forceRenderSurface(false) 47 , m_forceRenderSurface(false)
47 , m_isContainerForFixedPositionLayers(false) 48 , m_isContainerForFixedPositionLayers(false)
48 , m_fixedToContainerLayer(false) 49 , m_fixedToContainerLayer(false)
49 , m_renderTarget(0) 50 , m_renderTarget(0)
50 , m_drawDepth(0) 51 , m_drawDepth(0)
51 , m_drawOpacity(0) 52 , m_drawOpacity(0)
52 , m_drawOpacityIsAnimating(false) 53 , m_drawOpacityIsAnimating(false)
53 , m_debugBorderColor(0) 54 , m_debugBorderColor(0)
54 , m_debugBorderWidth(0) 55 , m_debugBorderWidth(0)
56 , m_filter(0)
55 , m_drawTransformIsAnimating(false) 57 , m_drawTransformIsAnimating(false)
56 , m_screenSpaceTransformIsAnimating(false) 58 , m_screenSpaceTransformIsAnimating(false)
57 #ifndef NDEBUG 59 #ifndef NDEBUG
58 , m_betweenWillDrawAndDidDraw(false) 60 , m_betweenWillDrawAndDidDraw(false)
59 #endif 61 #endif
60 , m_layerAnimationController(CCLayerAnimationController::create(this)) 62 , m_layerAnimationController(CCLayerAnimationController::create(this))
61 { 63 {
62 DCHECK(CCProxy::isImplThread()); 64 DCHECK(CCProxy::isImplThread());
63 DCHECK(m_layerId > 0); 65 DCHECK(m_layerId > 0);
64 } 66 }
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 484
483 void CCLayerImpl::setBackgroundFilters(const WebKit::WebFilterOperations& backgr oundFilters) 485 void CCLayerImpl::setBackgroundFilters(const WebKit::WebFilterOperations& backgr oundFilters)
484 { 486 {
485 if (m_backgroundFilters == backgroundFilters) 487 if (m_backgroundFilters == backgroundFilters)
486 return; 488 return;
487 489
488 m_backgroundFilters = backgroundFilters; 490 m_backgroundFilters = backgroundFilters;
489 m_layerPropertyChanged = true; 491 m_layerPropertyChanged = true;
490 } 492 }
491 493
494 void CCLayerImpl::setFilter(SkImageFilter* filter)
495 {
496 if (m_filter == filter)
497 return;
498
499 SkRefCnt_SafeAssign(m_filter, filter);
500 noteLayerPropertyChangedForSubtree();
501 }
502
492 void CCLayerImpl::setMasksToBounds(bool masksToBounds) 503 void CCLayerImpl::setMasksToBounds(bool masksToBounds)
493 { 504 {
494 if (m_masksToBounds == masksToBounds) 505 if (m_masksToBounds == masksToBounds)
495 return; 506 return;
496 507
497 m_masksToBounds = masksToBounds; 508 m_masksToBounds = masksToBounds;
498 noteLayerPropertyChangedForSubtree(); 509 noteLayerPropertyChangedForSubtree();
499 } 510 }
500 511
501 void CCLayerImpl::setContentsOpaque(bool opaque) 512 void CCLayerImpl::setContentsOpaque(bool opaque)
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
671 682
672 void CCLayerImpl::setVerticalScrollbarLayer(CCScrollbarLayerImpl* scrollbarLayer ) 683 void CCLayerImpl::setVerticalScrollbarLayer(CCScrollbarLayerImpl* scrollbarLayer )
673 { 684 {
674 if (!m_scrollbarAnimationController) 685 if (!m_scrollbarAnimationController)
675 m_scrollbarAnimationController = CCScrollbarAnimationController::create( this); 686 m_scrollbarAnimationController = CCScrollbarAnimationController::create( this);
676 m_scrollbarAnimationController->setVerticalScrollbarLayer(scrollbarLayer); 687 m_scrollbarAnimationController->setVerticalScrollbarLayer(scrollbarLayer);
677 m_scrollbarAnimationController->updateScrollOffset(this); 688 m_scrollbarAnimationController->updateScrollOffset(this);
678 } 689 }
679 690
680 } 691 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698