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

Side by Side Diff: Source/core/rendering/RenderLayerBlendInfo.h

Issue 99883002: Refactor BlendMode into a separate class. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: Created 7 years 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
OLDNEW
(Empty)
1 /*
2 * Copyright (C) 2003, 2009, 2012 Apple Inc. All rights reserved.
3 * Copyright (C) 2013 Intel Corporation. All rights reserved.
4 *
5 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
6 *
7 * Other contributors:
8 * Robert O'Callahan <roc+@cs.cmu.edu>
9 * David Baron <dbaron@fas.harvard.edu>
10 * Christian Biesinger <cbiesinger@web.de>
11 * Randall Jesup <rjesup@wgate.com>
12 * Roland Mainz <roland.mainz@informatik.med.uni-giessen.de>
13 * Josh Soref <timeless@mac.com>
14 * Boris Zbarsky <bzbarsky@mit.edu>
15 *
16 * This library is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU Lesser General Public
18 * License as published by the Free Software Foundation; either
19 * version 2.1 of the License, or (at your option) any later version.
20 *
21 * This library is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24 * Lesser General Public License for more details.
25 *
26 * You should have received a copy of the GNU Lesser General Public
27 * License along with this library; if not, write to the Free Software
28 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 US A
29 *
30 * Alternatively, the contents of this file may be used under the terms
31 * of either the Mozilla Public License Version 1.1, found at
32 * http://www.mozilla.org/MPL/ (the "MPL") or the GNU General Public
33 * License Version 2.0, found at http://www.fsf.org/copyleft/gpl.html
34 * (the "GPL"), in which case the provisions of the MPL or the GPL are
35 * applicable instead of those above. If you wish to allow use of your
36 * version of this file only under the terms of one of those two
37 * licenses (the MPL or the GPL) and not to allow others to use your
38 * version of this file under the LGPL, indicate your decision by
39 * deletingthe provisions above and replace them with the notice and
40 * other provisions required by the MPL or the GPL, as the case may be.
41 * If you do not delete the provisions above, a recipient may use your
42 * version of this file under any of the LGPL, the MPL or the GPL.
43 */
44
45 #ifndef RenderLayerBlendInfo_h
46 #define RenderLayerBlendInfo_h
47
48 #include "public/platform/WebBlendMode.h"
49 #include "wtf/Assertions.h"
50 #include "wtf/Noncopyable.h"
51
52 namespace WebCore {
53
54 class RenderLayerModelObject;
55
56 class RenderLayerBlendInfo {
57 WTF_MAKE_NONCOPYABLE(RenderLayerBlendInfo);
58 public:
59 explicit RenderLayerBlendInfo(RenderLayerModelObject*);
Julien - ping for review 2013/12/10 00:55:09 Isn't this object limited to RenderBox?
dsinclair 2013/12/13 16:53:59 Added a FIXME.
Julien - ping for review 2013/12/16 11:52:15 I don't think a FIXME is the right solution here.
dsinclair 2014/01/06 19:12:07 I took a longer look at this, and I'm not sure tha
Julien - ping for review 2014/01/09 14:13:50 My understanding is that the "applies to" section
60
61 bool hasBlendMode() const;
62 void updateBlendMode();
63
64 bool childLayerHasBlendMode() const
65 {
66 ASSERT(!m_childLayerHasBlendModeStatusDirty);
67 return m_childLayerHasBlendMode;
68 }
69 bool childLayerHasBlendModeWhileDirty() const { return m_childLayerHasBlendM ode; }
70
71 void setChildLayerHasBlendMode(bool b) { m_childLayerHasBlendMode = b; }
72 void updateChildLayerHasBlendMode(bool b) { m_childLayerHasBlendMode |= b; }
73
74 bool childLayerHasBlendModeStatusDirty() const { return m_childLayerHasBlend ModeStatusDirty; }
75 void setChildLayerHasBlendModeStatusDirty(bool b) { m_childLayerHasBlendMode StatusDirty = b; }
76 void ChildLayerHasBlendModeStatusDirty(bool b) { m_childLayerHasBlendModeSta tusDirty = b; }
Julien - ping for review 2013/12/10 00:55:09 This function should be removed.
dsinclair 2013/12/13 16:53:59 Done.
77
78 void setAncestorChainBlendedDescendant();
79 void dirtyAncestorChainBlendedDescendantStatus();
80
81 blink::WebBlendMode blendMode() const { return m_blendMode; }
82
83 private:
84 RenderLayerModelObject* m_renderer;
85 blink::WebBlendMode m_blendMode;
86
87 unsigned m_childLayerHasBlendMode : 1;
88 unsigned m_childLayerHasBlendModeStatusDirty : 1;
Julien - ping for review 2013/12/10 00:55:09 Because of these bits, we have to always allocate
Julien - ping for review 2013/12/10 01:46:13 This is a stale comment, actually moving them is f
89 };
90
91 } // namespace WebCore
92
93 #endif // RenderLayerBlendInfo_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698