| 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 "config.h" | 5 #include "config.h" |
| 6 #include "core/paint/Transform3DRecorder.h" | 6 #include "core/paint/Transform3DRecorder.h" |
| 7 | 7 |
| 8 #include "platform/RuntimeEnabledFeatures.h" | 8 #include "platform/RuntimeEnabledFeatures.h" |
| 9 #include "platform/graphics/GraphicsContext.h" | 9 #include "platform/graphics/GraphicsContext.h" |
| 10 #include "platform/graphics/paint/DisplayItemList.h" | 10 #include "platform/graphics/paint/DisplayItemList.h" |
| 11 #include "platform/graphics/paint/Transform3DDisplayItem.h" | 11 #include "platform/graphics/paint/Transform3DDisplayItem.h" |
| 12 | 12 |
| 13 namespace blink { | 13 namespace blink { |
| 14 | 14 |
| 15 Transform3DRecorder::Transform3DRecorder(GraphicsContext& context, const Display
ItemClientWrapper& client, DisplayItem::Type type, const TransformationMatrix& t
ransform) | 15 Transform3DRecorder::Transform3DRecorder(GraphicsContext& context, const Display
ItemClientWrapper& client, DisplayItem::Type type, const TransformationMatrix& t
ransform) |
| 16 : m_context(context) | 16 : m_context(context) |
| 17 , m_client(client) | 17 , m_client(client) |
| 18 , m_type(type) | 18 , m_type(type) |
| 19 { | 19 { |
| 20 ASSERT(DisplayItem::isTransform3DType(type)); | 20 ASSERT(DisplayItem::isTransform3DType(type)); |
| 21 m_skipRecordingForIdentityTransform = transform.isIdentity(); | 21 m_skipRecordingForIdentityTransform = transform.isIdentity(); |
| 22 | 22 |
| 23 if (m_skipRecordingForIdentityTransform) | 23 if (m_skipRecordingForIdentityTransform) |
| 24 return; | 24 return; |
| 25 | 25 |
| 26 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) { | 26 ALLOW_UNUSED_LOCAL(m_context); |
| 27 ASSERT(m_context.displayItemList()); | 27 ALLOW_UNUSED_LOCAL(m_client); |
| 28 if (m_context.displayItemList()->displayItemConstructionIsDisabled()) | 28 ALLOW_UNUSED_LOCAL(m_type); |
| 29 return; | 29 ALLOW_UNUSED_LOCAL(m_skipRecordingForIdentityTransform); |
| 30 m_context.displayItemList()->add(BeginTransform3DDisplayItem::create(m_c
lient, m_type, transform)); | 30 //if (RuntimeEnabledFeatures::slimmingPaintEnabled()) { |
| 31 } else { | 31 // ASSERT(m_context.displayItemList()); |
| 32 BeginTransform3DDisplayItem beginTransform(m_client, m_type, transform); | 32 // if (m_context.displayItemList()->displayItemConstructionIsDisabled()) |
| 33 beginTransform.replay(m_context); | 33 // return; |
| 34 } | 34 // m_context.displayItemList()->add(BeginTransform3DDisplayItem::create(m
_client, m_type, transform)); |
| 35 //} else { |
| 36 // BeginTransform3DDisplayItem beginTransform(m_client, m_type, transform
); |
| 37 // beginTransform.replay(m_context); |
| 38 //} |
| 35 } | 39 } |
| 36 | 40 |
| 37 Transform3DRecorder::~Transform3DRecorder() | 41 Transform3DRecorder::~Transform3DRecorder() |
| 38 { | 42 { |
| 39 if (m_skipRecordingForIdentityTransform) | 43 if (m_skipRecordingForIdentityTransform) |
| 40 return; | 44 return; |
| 41 | 45 |
| 42 DisplayItem::Type endType = DisplayItem::transform3DTypeToEndTransform3DType
(m_type); | 46 //DisplayItem::Type endType = DisplayItem::transform3DTypeToEndTransform3DTy
pe(m_type); |
| 43 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) { | 47 //if (RuntimeEnabledFeatures::slimmingPaintEnabled()) { |
| 44 ASSERT(m_context.displayItemList()); | 48 // ASSERT(m_context.displayItemList()); |
| 45 if (!m_context.displayItemList()->displayItemConstructionIsDisabled()) { | 49 // if (!m_context.displayItemList()->displayItemConstructionIsDisabled())
{ |
| 46 if (m_context.displayItemList()->lastDisplayItemIsNoopBegin()) | 50 // if (m_context.displayItemList()->lastDisplayItemIsNoopBegin()) |
| 47 m_context.displayItemList()->removeLastDisplayItem(); | 51 // m_context.displayItemList()->removeLastDisplayItem(); |
| 48 else | 52 // else |
| 49 m_context.displayItemList()->add(EndTransform3DDisplayItem::crea
te(m_client, endType)); | 53 // m_context.displayItemList()->add(EndTransform3DDisplayItem::cr
eate(m_client, endType)); |
| 50 } | 54 // } |
| 51 } else { | 55 //} else { |
| 52 EndTransform3DDisplayItem endTransform(m_client, endType); | 56 // EndTransform3DDisplayItem endTransform(m_client, endType); |
| 53 endTransform.replay(m_context); | 57 // endTransform.replay(m_context); |
| 54 } | 58 //} |
| 55 } | 59 } |
| 56 | 60 |
| 57 } // namespace blink | 61 } // namespace blink |
| OLD | NEW |