| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 #if ENABLE(ASSERT) | 112 #if ENABLE(ASSERT) |
| 113 if (m_client) | 113 if (m_client) |
| 114 m_client->verifyNotPainting(); | 114 m_client->verifyNotPainting(); |
| 115 #endif | 115 #endif |
| 116 | 116 |
| 117 m_contentLayerDelegate = adoptPtr(new ContentLayerDelegate(this)); | 117 m_contentLayerDelegate = adoptPtr(new ContentLayerDelegate(this)); |
| 118 m_layer = adoptPtr(Platform::current()->compositorSupport()->createContentLa
yer(m_contentLayerDelegate.get())); | 118 m_layer = adoptPtr(Platform::current()->compositorSupport()->createContentLa
yer(m_contentLayerDelegate.get())); |
| 119 m_layer->layer()->setDrawsContent(m_drawsContent && m_contentsVisible); | 119 m_layer->layer()->setDrawsContent(m_drawsContent && m_contentsVisible); |
| 120 m_layer->layer()->setWebLayerClient(this); | 120 m_layer->layer()->setWebLayerClient(this); |
| 121 m_layer->setAutomaticallyComputeRasterScale(true); | 121 m_layer->setAutomaticallyComputeRasterScale(true); |
| 122 |
| 123 // TODO(rbyers): Expose control over this to the web - crbug.com/489802: |
| 124 setScrollBlocksOn(WebScrollBlocksOnStartTouch | WebScrollBlocksOnWheelEvent)
; |
| 122 } | 125 } |
| 123 | 126 |
| 124 GraphicsLayer::~GraphicsLayer() | 127 GraphicsLayer::~GraphicsLayer() |
| 125 { | 128 { |
| 126 for (size_t i = 0; i < m_linkHighlights.size(); ++i) | 129 for (size_t i = 0; i < m_linkHighlights.size(); ++i) |
| 127 m_linkHighlights[i]->clearCurrentGraphicsLayer(); | 130 m_linkHighlights[i]->clearCurrentGraphicsLayer(); |
| 128 m_linkHighlights.clear(); | 131 m_linkHighlights.clear(); |
| 129 | 132 |
| 130 #if ENABLE(ASSERT) | 133 #if ENABLE(ASSERT) |
| 131 if (m_client) | 134 if (m_client) |
| (...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 590 | 593 |
| 591 if (m_size != IntSize()) | 594 if (m_size != IntSize()) |
| 592 json->setArray("bounds", sizeAsJSONArray(m_size)); | 595 json->setArray("bounds", sizeAsJSONArray(m_size)); |
| 593 | 596 |
| 594 if (m_opacity != 1) | 597 if (m_opacity != 1) |
| 595 json->setNumber("opacity", m_opacity); | 598 json->setNumber("opacity", m_opacity); |
| 596 | 599 |
| 597 if (m_blendMode != WebBlendModeNormal) | 600 if (m_blendMode != WebBlendModeNormal) |
| 598 json->setString("blendMode", compositeOperatorName(CompositeSourceOver,
m_blendMode)); | 601 json->setString("blendMode", compositeOperatorName(CompositeSourceOver,
m_blendMode)); |
| 599 | 602 |
| 600 if ((flags & LayerTreeIncludesScrollBlocksOn) && m_scrollBlocksOn) { | |
| 601 RefPtr<JSONArray> scrollBlocksOnJSON = adoptRef(new JSONArray); | |
| 602 if (m_scrollBlocksOn & WebScrollBlocksOnStartTouch) | |
| 603 scrollBlocksOnJSON->pushString("StartTouch"); | |
| 604 if (m_scrollBlocksOn & WebScrollBlocksOnWheelEvent) | |
| 605 scrollBlocksOnJSON->pushString("WheelEvent"); | |
| 606 if (m_scrollBlocksOn & WebScrollBlocksOnScrollEvent) | |
| 607 scrollBlocksOnJSON->pushString("ScrollEvent"); | |
| 608 json->setArray("scrollBlocksOn", scrollBlocksOnJSON); | |
| 609 } | |
| 610 | |
| 611 if (m_isRootForIsolatedGroup) | 603 if (m_isRootForIsolatedGroup) |
| 612 json->setBoolean("isolate", m_isRootForIsolatedGroup); | 604 json->setBoolean("isolate", m_isRootForIsolatedGroup); |
| 613 | 605 |
| 614 if (m_contentsOpaque) | 606 if (m_contentsOpaque) |
| 615 json->setBoolean("contentsOpaque", m_contentsOpaque); | 607 json->setBoolean("contentsOpaque", m_contentsOpaque); |
| 616 | 608 |
| 617 if (!m_shouldFlattenTransform) | 609 if (!m_shouldFlattenTransform) |
| 618 json->setBoolean("shouldFlattenTransform", m_shouldFlattenTransform); | 610 json->setBoolean("shouldFlattenTransform", m_shouldFlattenTransform); |
| 619 | 611 |
| 620 if (m_3dRenderingContext) { | 612 if (m_3dRenderingContext) { |
| (...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1153 { | 1145 { |
| 1154 if (!layer) { | 1146 if (!layer) { |
| 1155 fprintf(stderr, "Cannot showGraphicsLayerTree for (nil).\n"); | 1147 fprintf(stderr, "Cannot showGraphicsLayerTree for (nil).\n"); |
| 1156 return; | 1148 return; |
| 1157 } | 1149 } |
| 1158 | 1150 |
| 1159 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); | 1151 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); |
| 1160 fprintf(stderr, "%s\n", output.utf8().data()); | 1152 fprintf(stderr, "%s\n", output.utf8().data()); |
| 1161 } | 1153 } |
| 1162 #endif | 1154 #endif |
| OLD | NEW |