| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2007 Alp Toker <alp@atoker.com> | 3 * Copyright (C) 2007 Alp Toker <alp@atoker.com> |
| 4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. | 4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 858 bool HTMLCanvasElement::ShouldUseDisplayList() { | 858 bool HTMLCanvasElement::ShouldUseDisplayList() { |
| 859 // Rasterization of web contents will blend in the output space. Only embed | 859 // Rasterization of web contents will blend in the output space. Only embed |
| 860 // the canvas as a display list if it intended to do output space blending as | 860 // the canvas as a display list if it intended to do output space blending as |
| 861 // well. | 861 // well. |
| 862 if (!context_->color_params().UsesOutputSpaceBlending()) | 862 if (!context_->color_params().UsesOutputSpaceBlending()) |
| 863 return false; | 863 return false; |
| 864 | 864 |
| 865 if (RuntimeEnabledFeatures::forceDisplayList2dCanvasEnabled()) | 865 if (RuntimeEnabledFeatures::forceDisplayList2dCanvasEnabled()) |
| 866 return true; | 866 return true; |
| 867 | 867 |
| 868 if (MemoryCoordinator::IsLowEndDevice()) |
| 869 return false; |
| 870 |
| 868 if (!RuntimeEnabledFeatures::displayList2dCanvasEnabled()) | 871 if (!RuntimeEnabledFeatures::displayList2dCanvasEnabled()) |
| 869 return false; | 872 return false; |
| 870 | 873 |
| 871 return true; | 874 return true; |
| 872 } | 875 } |
| 873 | 876 |
| 874 std::unique_ptr<ImageBufferSurface> | 877 std::unique_ptr<ImageBufferSurface> |
| 875 HTMLCanvasElement::CreateWebGLImageBufferSurface(OpacityMode opacity_mode) { | 878 HTMLCanvasElement::CreateWebGLImageBufferSurface(OpacityMode opacity_mode) { |
| 876 DCHECK(Is3d()); | 879 DCHECK(Is3d()); |
| 877 // If 3d, but the use of the canvas will be for non-accelerated content | 880 // If 3d, but the use of the canvas will be for non-accelerated content |
| (...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1430 // Creates a placeholder layer first before Surface is created. | 1433 // Creates a placeholder layer first before Surface is created. |
| 1431 surface_layer_bridge_->CreateSolidColorLayer(); | 1434 surface_layer_bridge_->CreateSolidColorLayer(); |
| 1432 } | 1435 } |
| 1433 } | 1436 } |
| 1434 | 1437 |
| 1435 void HTMLCanvasElement::OnWebLayerReplaced() { | 1438 void HTMLCanvasElement::OnWebLayerReplaced() { |
| 1436 SetNeedsCompositingUpdate(); | 1439 SetNeedsCompositingUpdate(); |
| 1437 } | 1440 } |
| 1438 | 1441 |
| 1439 } // namespace blink | 1442 } // namespace blink |
| OLD | NEW |