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 1217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1228 if (ExpensiveCanvasHeuristicParameters::EnableAccelerationToAvoidReadbacks && | 1228 if (ExpensiveCanvasHeuristicParameters::EnableAccelerationToAvoidReadbacks && |
1229 source->isAccelerated() && !buffer()->isAccelerated() && | 1229 source->isAccelerated() && !buffer()->isAccelerated() && |
1230 shouldAccelerate(IgnoreResourceLimitCriteria)) { | 1230 shouldAccelerate(IgnoreResourceLimitCriteria)) { |
1231 OpacityMode opacityMode = | 1231 OpacityMode opacityMode = |
1232 m_context->creationAttributes().alpha() ? NonOpaque : Opaque; | 1232 m_context->creationAttributes().alpha() ? NonOpaque : Opaque; |
1233 int msaaSampleCount = 0; | 1233 int msaaSampleCount = 0; |
1234 std::unique_ptr<ImageBufferSurface> surface = | 1234 std::unique_ptr<ImageBufferSurface> surface = |
1235 createAcceleratedImageBufferSurface(opacityMode, &msaaSampleCount); | 1235 createAcceleratedImageBufferSurface(opacityMode, &msaaSampleCount); |
1236 if (surface) { | 1236 if (surface) { |
1237 buffer()->setSurface(std::move(surface)); | 1237 buffer()->setSurface(std::move(surface)); |
1238 setNeedsCompositingUpdate(); | |
1239 } | 1238 } |
1240 } | 1239 } |
1241 } | 1240 } |
1242 | 1241 |
1243 PassRefPtr<Image> HTMLCanvasElement::getSourceImageForCanvas( | 1242 PassRefPtr<Image> HTMLCanvasElement::getSourceImageForCanvas( |
1244 SourceImageStatus* status, | 1243 SourceImageStatus* status, |
1245 AccelerationHint hint, | 1244 AccelerationHint hint, |
1246 SnapshotReason reason, | 1245 SnapshotReason reason, |
1247 const FloatSize&) const { | 1246 const FloatSize&) const { |
1248 if (!width() || !height()) { | 1247 if (!width() || !height()) { |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1463 // Creates a placeholder layer first before Surface is created. | 1462 // Creates a placeholder layer first before Surface is created. |
1464 m_surfaceLayerBridge->createSolidColorLayer(); | 1463 m_surfaceLayerBridge->createSolidColorLayer(); |
1465 } | 1464 } |
1466 } | 1465 } |
1467 | 1466 |
1468 void HTMLCanvasElement::OnWebLayerReplaced() { | 1467 void HTMLCanvasElement::OnWebLayerReplaced() { |
1469 setNeedsCompositingUpdate(); | 1468 setNeedsCompositingUpdate(); |
1470 } | 1469 } |
1471 | 1470 |
1472 } // namespace blink | 1471 } // namespace blink |
OLD | NEW |