| 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 889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 900 // Image will require a pixel readback, but that is unavoidable in this case. | 900 // Image will require a pixel readback, but that is unavoidable in this case. |
| 901 auto surface = WTF::wrapUnique(new AcceleratedImageBufferSurface( | 901 auto surface = WTF::wrapUnique(new AcceleratedImageBufferSurface( |
| 902 size(), opacityMode, m_context->skSurfaceColorSpace(), | 902 size(), opacityMode, m_context->skSurfaceColorSpace(), |
| 903 m_context->colorType())); | 903 m_context->colorType())); |
| 904 if (surface->isValid()) | 904 if (surface->isValid()) |
| 905 return std::move(surface); | 905 return std::move(surface); |
| 906 return nullptr; | 906 return nullptr; |
| 907 } | 907 } |
| 908 | 908 |
| 909 std::unique_ptr<ImageBufferSurface> | 909 std::unique_ptr<ImageBufferSurface> |
| 910 HTMLCanvasElement::createAcceleratedImageBufferSurface( | 910 HTMLCanvasElement::createAcceleratedImageBufferSurface(OpacityMode opacityMode, |
| 911 OpacityMode opacityMode, | 911 int* msaaSampleCount) { |
| 912 int* msaaSampleCount) { | |
| 913 if (document().settings()) { | 912 if (document().settings()) { |
| 914 *msaaSampleCount = | 913 *msaaSampleCount = |
| 915 document().settings()->getAccelerated2dCanvasMSAASampleCount(); | 914 document().settings()->getAccelerated2dCanvasMSAASampleCount(); |
| 916 } | 915 } |
| 917 | 916 |
| 918 // Avoid creating |contextProvider| until we're sure we want to try use it, | 917 // Avoid creating |contextProvider| until we're sure we want to try use it, |
| 919 // since it costs us GPU memory. | 918 // since it costs us GPU memory. |
| 920 std::unique_ptr<WebGraphicsContext3DProvider> contextProvider( | 919 std::unique_ptr<WebGraphicsContext3DProvider> contextProvider( |
| 921 Platform::current()->createSharedOffscreenGraphicsContext3DProvider()); | 920 Platform::current()->createSharedOffscreenGraphicsContext3DProvider()); |
| 922 if (!contextProvider) { | 921 if (!contextProvider) { |
| (...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1441 // Creates a placeholder layer first before Surface is created. | 1440 // Creates a placeholder layer first before Surface is created. |
| 1442 m_surfaceLayerBridge->createSolidColorLayer(); | 1441 m_surfaceLayerBridge->createSolidColorLayer(); |
| 1443 } | 1442 } |
| 1444 } | 1443 } |
| 1445 | 1444 |
| 1446 void HTMLCanvasElement::OnWebLayerReplaced() { | 1445 void HTMLCanvasElement::OnWebLayerReplaced() { |
| 1447 setNeedsCompositingUpdate(); | 1446 setNeedsCompositingUpdate(); |
| 1448 } | 1447 } |
| 1449 | 1448 |
| 1450 } // namespace blink | 1449 } // namespace blink |
| OLD | NEW |