OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "core/dom/CompositorProxy.h" | 5 #include "core/dom/CompositorProxy.h" |
6 | 6 |
7 #include "bindings/core/v8/ExceptionMessages.h" | 7 #include "bindings/core/v8/ExceptionMessages.h" |
8 #include "bindings/core/v8/ExceptionState.h" | 8 #include "bindings/core/v8/ExceptionState.h" |
9 #include "core/dom/DOMNodeIds.h" | 9 #include "core/dom/DOMNodeIds.h" |
10 #include "core/dom/ExceptionCode.h" | 10 #include "core/dom/ExceptionCode.h" |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 return 0.0; | 197 return 0.0; |
198 return m_state->scrollTop(); | 198 return m_state->scrollTop(); |
199 } | 199 } |
200 | 200 |
201 DOMMatrix* CompositorProxy::transform(ExceptionState& exceptionState) const | 201 DOMMatrix* CompositorProxy::transform(ExceptionState& exceptionState) const |
202 { | 202 { |
203 if (raiseExceptionIfMutationNotAllowed(exceptionState)) | 203 if (raiseExceptionIfMutationNotAllowed(exceptionState)) |
204 return nullptr; | 204 return nullptr; |
205 if (raiseExceptionIfNotMutable(CompositorMutableProperty::kTransform, except
ionState)) | 205 if (raiseExceptionIfNotMutable(CompositorMutableProperty::kTransform, except
ionState)) |
206 return nullptr; | 206 return nullptr; |
207 return DOMMatrix::create(m_state->transform()); | 207 return DOMMatrix::create(m_state->transform(), exceptionState); |
208 } | 208 } |
209 | 209 |
210 void CompositorProxy::setOpacity(double opacity, ExceptionState& exceptionState) | 210 void CompositorProxy::setOpacity(double opacity, ExceptionState& exceptionState) |
211 { | 211 { |
212 if (raiseExceptionIfMutationNotAllowed(exceptionState)) | 212 if (raiseExceptionIfMutationNotAllowed(exceptionState)) |
213 return; | 213 return; |
214 if (raiseExceptionIfNotMutable(CompositorMutableProperty::kOpacity, exceptio
nState)) | 214 if (raiseExceptionIfNotMutable(CompositorMutableProperty::kOpacity, exceptio
nState)) |
215 return; | 215 return; |
216 m_state->setOpacity(std::min(1., std::max(0., opacity))); | 216 m_state->setOpacity(std::min(1., std::max(0., opacity))); |
217 } | 217 } |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 return; | 273 return; |
274 m_connected = false; | 274 m_connected = false; |
275 if (isMainThread()) { | 275 if (isMainThread()) { |
276 decrementCompositorProxiedPropertiesForElement(m_elementId, m_compositor
MutableProperties); | 276 decrementCompositorProxiedPropertiesForElement(m_elementId, m_compositor
MutableProperties); |
277 } else { | 277 } else { |
278 Platform::current()->mainThread()->getWebTaskRunner()->postTask(BLINK_FR
OM_HERE, crossThreadBind(&decrementCompositorProxiedPropertiesForElement, m_elem
entId, m_compositorMutableProperties)); | 278 Platform::current()->mainThread()->getWebTaskRunner()->postTask(BLINK_FR
OM_HERE, crossThreadBind(&decrementCompositorProxiedPropertiesForElement, m_elem
entId, m_compositorMutableProperties)); |
279 } | 279 } |
280 } | 280 } |
281 | 281 |
282 } // namespace blink | 282 } // namespace blink |
OLD | NEW |