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 935 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
946 CanvasMetrics::CountCanvasContextUsage( | 946 CanvasMetrics::CountCanvasContextUsage( |
947 CanvasMetrics::kGPUAccelerated2DCanvasImageBufferCreated); | 947 CanvasMetrics::kGPUAccelerated2DCanvasImageBufferCreated); |
948 return std::move(surface); | 948 return std::move(surface); |
949 } | 949 } |
950 | 950 |
951 std::unique_ptr<ImageBufferSurface> | 951 std::unique_ptr<ImageBufferSurface> |
952 HTMLCanvasElement::CreateUnacceleratedImageBufferSurface( | 952 HTMLCanvasElement::CreateUnacceleratedImageBufferSurface( |
953 OpacityMode opacity_mode) { | 953 OpacityMode opacity_mode) { |
954 if (ShouldUseDisplayList()) { | 954 if (ShouldUseDisplayList()) { |
955 auto surface = WTF::MakeUnique<RecordingImageBufferSurface>( | 955 auto surface = WTF::MakeUnique<RecordingImageBufferSurface>( |
956 Size(), opacity_mode, context_->color_params()); | 956 Size(), RecordingImageBufferSurface::kAllowFallback, opacity_mode, |
pdr.
2017/04/25 23:00:27
Should UnacceleratedImageBufferSurface also take a
Justin Novosad
2017/04/26 14:25:25
No, there is no fallback functionality in Unaccele
| |
957 context_->color_params()); | |
957 if (surface->IsValid()) { | 958 if (surface->IsValid()) { |
958 CanvasMetrics::CountCanvasContextUsage( | 959 CanvasMetrics::CountCanvasContextUsage( |
959 CanvasMetrics::kDisplayList2DCanvasImageBufferCreated); | 960 CanvasMetrics::kDisplayList2DCanvasImageBufferCreated); |
960 return std::move(surface); | 961 return std::move(surface); |
961 } | 962 } |
962 // We fallback to a non-display-list surface without recording a metric | 963 // We fallback to a non-display-list surface without recording a metric |
963 // here. | 964 // here. |
964 } | 965 } |
965 | 966 |
966 auto surface = WTF::MakeUnique<UnacceleratedImageBufferSurface>( | 967 auto surface = WTF::MakeUnique<UnacceleratedImageBufferSurface>( |
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1458 // Creates a placeholder layer first before Surface is created. | 1459 // Creates a placeholder layer first before Surface is created. |
1459 surface_layer_bridge_->CreateSolidColorLayer(); | 1460 surface_layer_bridge_->CreateSolidColorLayer(); |
1460 } | 1461 } |
1461 } | 1462 } |
1462 | 1463 |
1463 void HTMLCanvasElement::OnWebLayerReplaced() { | 1464 void HTMLCanvasElement::OnWebLayerReplaced() { |
1464 SetNeedsCompositingUpdate(); | 1465 SetNeedsCompositingUpdate(); |
1465 } | 1466 } |
1466 | 1467 |
1467 } // namespace blink | 1468 } // namespace blink |
OLD | NEW |