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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 PassOwnPtr<GraphicsLayer> GraphicsLayer::create(GraphicsLayerFactory* factory, G
raphicsLayerClient* client) | 89 PassOwnPtr<GraphicsLayer> GraphicsLayer::create(GraphicsLayerFactory* factory, G
raphicsLayerClient* client) |
90 { | 90 { |
91 return factory->createGraphicsLayer(client); | 91 return factory->createGraphicsLayer(client); |
92 } | 92 } |
93 | 93 |
94 GraphicsLayer::GraphicsLayer(GraphicsLayerClient* client) | 94 GraphicsLayer::GraphicsLayer(GraphicsLayerClient* client) |
95 : m_client(client) | 95 : m_client(client) |
96 , m_backgroundColor(Color::transparent) | 96 , m_backgroundColor(Color::transparent) |
97 , m_opacity(1) | 97 , m_opacity(1) |
98 , m_blendMode(WebBlendModeNormal) | 98 , m_blendMode(WebBlendModeNormal) |
99 , m_scrollBlocksOn(WebScrollBlocksOnNone) | |
100 , m_hasTransformOrigin(false) | 99 , m_hasTransformOrigin(false) |
101 , m_contentsOpaque(false) | 100 , m_contentsOpaque(false) |
102 , m_shouldFlattenTransform(true) | 101 , m_shouldFlattenTransform(true) |
103 , m_backfaceVisibility(true) | 102 , m_backfaceVisibility(true) |
104 , m_masksToBounds(false) | 103 , m_masksToBounds(false) |
105 , m_drawsContent(false) | 104 , m_drawsContent(false) |
106 , m_contentsVisible(true) | 105 , m_contentsVisible(true) |
107 , m_isRootForIsolatedGroup(false) | 106 , m_isRootForIsolatedGroup(false) |
108 , m_hasScrollParent(false) | 107 , m_hasScrollParent(false) |
109 , m_hasClipParent(false) | 108 , m_hasClipParent(false) |
(...skipping 14 matching lines...) Expand all Loading... |
124 { | 123 { |
125 #if ENABLE(ASSERT) | 124 #if ENABLE(ASSERT) |
126 if (m_client) | 125 if (m_client) |
127 m_client->verifyNotPainting(); | 126 m_client->verifyNotPainting(); |
128 #endif | 127 #endif |
129 | 128 |
130 m_contentLayerDelegate = adoptPtr(new ContentLayerDelegate(this)); | 129 m_contentLayerDelegate = adoptPtr(new ContentLayerDelegate(this)); |
131 m_layer = adoptPtr(Platform::current()->compositorSupport()->createContentLa
yer(m_contentLayerDelegate.get())); | 130 m_layer = adoptPtr(Platform::current()->compositorSupport()->createContentLa
yer(m_contentLayerDelegate.get())); |
132 m_layer->layer()->setDrawsContent(m_drawsContent && m_contentsVisible); | 131 m_layer->layer()->setDrawsContent(m_drawsContent && m_contentsVisible); |
133 m_layer->layer()->setLayerClient(this); | 132 m_layer->layer()->setLayerClient(this); |
134 | |
135 // TODO(rbyers): Expose control over this to the web - crbug.com/489802: | |
136 setScrollBlocksOn(WebScrollBlocksOnStartTouch | WebScrollBlocksOnWheelEvent)
; | |
137 } | 133 } |
138 | 134 |
139 GraphicsLayer::~GraphicsLayer() | 135 GraphicsLayer::~GraphicsLayer() |
140 { | 136 { |
141 for (size_t i = 0; i < m_linkHighlights.size(); ++i) | 137 for (size_t i = 0; i < m_linkHighlights.size(); ++i) |
142 m_linkHighlights[i]->clearCurrentGraphicsLayer(); | 138 m_linkHighlights[i]->clearCurrentGraphicsLayer(); |
143 m_linkHighlights.clear(); | 139 m_linkHighlights.clear(); |
144 | 140 |
145 #if ENABLE(ASSERT) | 141 #if ENABLE(ASSERT) |
146 if (m_client) | 142 if (m_client) |
(...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1003 } | 999 } |
1004 | 1000 |
1005 void GraphicsLayer::setBlendMode(WebBlendMode blendMode) | 1001 void GraphicsLayer::setBlendMode(WebBlendMode blendMode) |
1006 { | 1002 { |
1007 if (m_blendMode == blendMode) | 1003 if (m_blendMode == blendMode) |
1008 return; | 1004 return; |
1009 m_blendMode = blendMode; | 1005 m_blendMode = blendMode; |
1010 platformLayer()->setBlendMode(blendMode); | 1006 platformLayer()->setBlendMode(blendMode); |
1011 } | 1007 } |
1012 | 1008 |
1013 void GraphicsLayer::setScrollBlocksOn(WebScrollBlocksOn scrollBlocksOn) | |
1014 { | |
1015 if (m_scrollBlocksOn == scrollBlocksOn) | |
1016 return; | |
1017 m_scrollBlocksOn = scrollBlocksOn; | |
1018 platformLayer()->setScrollBlocksOn(scrollBlocksOn); | |
1019 } | |
1020 | |
1021 void GraphicsLayer::setIsRootForIsolatedGroup(bool isolated) | 1009 void GraphicsLayer::setIsRootForIsolatedGroup(bool isolated) |
1022 { | 1010 { |
1023 if (m_isRootForIsolatedGroup == isolated) | 1011 if (m_isRootForIsolatedGroup == isolated) |
1024 return; | 1012 return; |
1025 m_isRootForIsolatedGroup = isolated; | 1013 m_isRootForIsolatedGroup = isolated; |
1026 platformLayer()->setIsRootForIsolatedGroup(isolated); | 1014 platformLayer()->setIsRootForIsolatedGroup(isolated); |
1027 } | 1015 } |
1028 | 1016 |
1029 void GraphicsLayer::setContentsNeedsDisplay() | 1017 void GraphicsLayer::setContentsNeedsDisplay() |
1030 { | 1018 { |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1264 { | 1252 { |
1265 if (!layer) { | 1253 if (!layer) { |
1266 fprintf(stderr, "Cannot showGraphicsLayerTree for (nil).\n"); | 1254 fprintf(stderr, "Cannot showGraphicsLayerTree for (nil).\n"); |
1267 return; | 1255 return; |
1268 } | 1256 } |
1269 | 1257 |
1270 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); | 1258 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); |
1271 fprintf(stderr, "%s\n", output.utf8().data()); | 1259 fprintf(stderr, "%s\n", output.utf8().data()); |
1272 } | 1260 } |
1273 #endif | 1261 #endif |
OLD | NEW |