OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/paint/Transform3DRecorder.h" | 5 #include "core/paint/Transform3DRecorder.h" |
6 | 6 |
7 #include "platform/graphics/GraphicsContext.h" | 7 #include "platform/graphics/GraphicsContext.h" |
8 #include "platform/graphics/paint/PaintController.h" | 8 #include "platform/graphics/paint/PaintController.h" |
9 #include "platform/graphics/paint/Transform3DDisplayItem.h" | 9 #include "platform/graphics/paint/Transform3DDisplayItem.h" |
10 | 10 |
11 namespace blink { | 11 namespace blink { |
12 | 12 |
13 Transform3DRecorder::Transform3DRecorder(GraphicsContext& context, | 13 Transform3DRecorder::Transform3DRecorder( |
14 const DisplayItemClient& client, | 14 GraphicsContext& context, |
15 DisplayItem::Type type, | 15 DisplayItem::Type type, |
16 const TransformationMatrix& transform, | 16 const TransformationMatrix& transform, |
17 const FloatPoint3D& transformOrigin) | 17 const FloatPoint3D& transformOrigin, |
18 : m_context(context), m_client(client), m_type(type) { | 18 const LayoutRect& visualRect, |
| 19 const WTF::String& debugName, |
| 20 bool paintedOutputOfObjectHasNoEffectRegardlessOfSize) |
| 21 : m_context(context), |
| 22 m_client(visualRect, |
| 23 debugName, |
| 24 paintedOutputOfObjectHasNoEffectRegardlessOfSize), |
| 25 m_type(type) { |
19 DCHECK(DisplayItem::isTransform3DType(type)); | 26 DCHECK(DisplayItem::isTransform3DType(type)); |
20 m_skipRecordingForIdentityTransform = transform.isIdentity(); | 27 m_skipRecordingForIdentityTransform = transform.isIdentity(); |
21 | 28 |
22 if (m_skipRecordingForIdentityTransform) | 29 if (m_skipRecordingForIdentityTransform) |
23 return; | 30 return; |
24 | 31 |
25 m_context.getPaintController().createAndAppend<BeginTransform3DDisplayItem>( | 32 m_context.getPaintController().createAndAppend<BeginTransform3DDisplayItem>( |
26 m_client, m_type, transform, transformOrigin); | 33 m_client, m_type, transform, transformOrigin); |
27 } | 34 } |
28 | 35 |
29 Transform3DRecorder::~Transform3DRecorder() { | 36 Transform3DRecorder::~Transform3DRecorder() { |
30 if (m_skipRecordingForIdentityTransform) | 37 if (m_skipRecordingForIdentityTransform) |
31 return; | 38 return; |
32 | 39 |
33 m_context.getPaintController().endItem<EndTransform3DDisplayItem>( | 40 m_context.getPaintController().endItem<EndTransform3DDisplayItem>( |
34 m_client, DisplayItem::transform3DTypeToEndTransform3DType(m_type)); | 41 m_client, DisplayItem::transform3DTypeToEndTransform3DType(m_type)); |
35 } | 42 } |
36 | 43 |
37 } // namespace blink | 44 } // namespace blink |
OLD | NEW |