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 4597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4608 return true; | 4608 return true; |
4609 } | 4609 } |
4610 | 4610 |
4611 // TODO(fmalita): figure why WebGLImageConversion::ImageExtractor can't handle | 4611 // TODO(fmalita): figure why WebGLImageConversion::ImageExtractor can't handle |
4612 // SVG-backed images, and get rid of this intermediate step. | 4612 // SVG-backed images, and get rid of this intermediate step. |
4613 PassRefPtr<Image> WebGLRenderingContextBase::drawImageIntoBuffer( | 4613 PassRefPtr<Image> WebGLRenderingContextBase::drawImageIntoBuffer( |
4614 PassRefPtr<Image> passImage, | 4614 PassRefPtr<Image> passImage, |
4615 int width, | 4615 int width, |
4616 int height, | 4616 int height, |
4617 const char* functionName) { | 4617 const char* functionName) { |
4618 RefPtr<Image> image(passImage); | 4618 RefPtr<Image> image(std::move(passImage)); |
4619 ASSERT(image); | 4619 ASSERT(image); |
4620 | 4620 |
4621 IntSize size(width, height); | 4621 IntSize size(width, height); |
4622 ImageBuffer* buf = m_generatedImageCache.imageBuffer(size); | 4622 ImageBuffer* buf = m_generatedImageCache.imageBuffer(size); |
4623 if (!buf) { | 4623 if (!buf) { |
4624 synthesizeGLError(GL_OUT_OF_MEMORY, functionName, "out of memory"); | 4624 synthesizeGLError(GL_OUT_OF_MEMORY, functionName, "out of memory"); |
4625 return nullptr; | 4625 return nullptr; |
4626 } | 4626 } |
4627 | 4627 |
4628 if (!image->currentFrameKnownToBeOpaque()) | 4628 if (!image->currentFrameKnownToBeOpaque()) |
(...skipping 3211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7840 | 7840 |
7841 void WebGLRenderingContextBase::getHTMLOrOffscreenCanvas( | 7841 void WebGLRenderingContextBase::getHTMLOrOffscreenCanvas( |
7842 HTMLCanvasElementOrOffscreenCanvas& result) const { | 7842 HTMLCanvasElementOrOffscreenCanvas& result) const { |
7843 if (canvas()) | 7843 if (canvas()) |
7844 result.setHTMLCanvasElement(canvas()); | 7844 result.setHTMLCanvasElement(canvas()); |
7845 else | 7845 else |
7846 result.setOffscreenCanvas(offscreenCanvas()); | 7846 result.setOffscreenCanvas(offscreenCanvas()); |
7847 } | 7847 } |
7848 | 7848 |
7849 } // namespace blink | 7849 } // namespace blink |
OLD | NEW |