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 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 IntSize(contents_rect_.Location().X(), contents_rect_.Location().Y())); | 381 IntSize(contents_rect_.Location().X(), contents_rect_.Location().Y())); |
382 } | 382 } |
383 } | 383 } |
384 | 384 |
385 static HashSet<int>* g_registered_layer_set; | 385 static HashSet<int>* g_registered_layer_set; |
386 | 386 |
387 void GraphicsLayer::RegisterContentsLayer(WebLayer* layer) { | 387 void GraphicsLayer::RegisterContentsLayer(WebLayer* layer) { |
388 if (!g_registered_layer_set) | 388 if (!g_registered_layer_set) |
389 g_registered_layer_set = new HashSet<int>; | 389 g_registered_layer_set = new HashSet<int>; |
390 if (g_registered_layer_set->Contains(layer->Id())) | 390 if (g_registered_layer_set->Contains(layer->Id())) |
391 CRASH(); | 391 IMMEDIATE_CRASH(); |
392 g_registered_layer_set->insert(layer->Id()); | 392 g_registered_layer_set->insert(layer->Id()); |
393 } | 393 } |
394 | 394 |
395 void GraphicsLayer::UnregisterContentsLayer(WebLayer* layer) { | 395 void GraphicsLayer::UnregisterContentsLayer(WebLayer* layer) { |
396 DCHECK(g_registered_layer_set); | 396 DCHECK(g_registered_layer_set); |
397 if (!g_registered_layer_set->Contains(layer->Id())) | 397 if (!g_registered_layer_set->Contains(layer->Id())) |
398 CRASH(); | 398 IMMEDIATE_CRASH(); |
399 g_registered_layer_set->erase(layer->Id()); | 399 g_registered_layer_set->erase(layer->Id()); |
400 } | 400 } |
401 | 401 |
402 void GraphicsLayer::SetContentsTo(WebLayer* layer) { | 402 void GraphicsLayer::SetContentsTo(WebLayer* layer) { |
403 bool children_changed = false; | 403 bool children_changed = false; |
404 if (layer) { | 404 if (layer) { |
405 DCHECK(g_registered_layer_set); | 405 DCHECK(g_registered_layer_set); |
406 if (!g_registered_layer_set->Contains(layer->Id())) | 406 if (!g_registered_layer_set->Contains(layer->Id())) |
407 CRASH(); | 407 IMMEDIATE_CRASH(); |
408 if (contents_layer_id_ != layer->Id()) { | 408 if (contents_layer_id_ != layer->Id()) { |
409 SetupContentsLayer(layer); | 409 SetupContentsLayer(layer); |
410 children_changed = true; | 410 children_changed = true; |
411 } | 411 } |
412 UpdateContentsRect(); | 412 UpdateContentsRect(); |
413 } else { | 413 } else { |
414 if (contents_layer_) { | 414 if (contents_layer_) { |
415 children_changed = true; | 415 children_changed = true; |
416 | 416 |
417 // The old contents layer will be removed via updateChildList. | 417 // The old contents layer will be removed via updateChildList. |
(...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1295 void showGraphicsLayerTree(const blink::GraphicsLayer* layer) { | 1295 void showGraphicsLayerTree(const blink::GraphicsLayer* layer) { |
1296 if (!layer) { | 1296 if (!layer) { |
1297 LOG(INFO) << "Cannot showGraphicsLayerTree for (nil)."; | 1297 LOG(INFO) << "Cannot showGraphicsLayerTree for (nil)."; |
1298 return; | 1298 return; |
1299 } | 1299 } |
1300 | 1300 |
1301 String output = layer->LayerTreeAsText(blink::kLayerTreeIncludesDebugInfo); | 1301 String output = layer->LayerTreeAsText(blink::kLayerTreeIncludesDebugInfo); |
1302 LOG(INFO) << output.Utf8().data(); | 1302 LOG(INFO) << output.Utf8().data(); |
1303 } | 1303 } |
1304 #endif | 1304 #endif |
OLD | NEW |