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 4561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4572 if (!buf) { | 4572 if (!buf) { |
4573 synthesizeGLError(GL_OUT_OF_MEMORY, functionName, "out of memory"); | 4573 synthesizeGLError(GL_OUT_OF_MEMORY, functionName, "out of memory"); |
4574 return nullptr; | 4574 return nullptr; |
4575 } | 4575 } |
4576 | 4576 |
4577 if (!image->currentFrameKnownToBeOpaque()) | 4577 if (!image->currentFrameKnownToBeOpaque()) |
4578 buf->canvas()->clear(SK_ColorTRANSPARENT); | 4578 buf->canvas()->clear(SK_ColorTRANSPARENT); |
4579 | 4579 |
4580 IntRect srcRect(IntPoint(), image->size()); | 4580 IntRect srcRect(IntPoint(), image->size()); |
4581 IntRect destRect(0, 0, size.width(), size.height()); | 4581 IntRect destRect(0, 0, size.width(), size.height()); |
4582 SkPaint paint; | 4582 PaintFlags paint; |
4583 // TODO(ccameron): WebGL should produce sRGB images. | 4583 // TODO(ccameron): WebGL should produce sRGB images. |
4584 // https://crbug.com/672299 | 4584 // https://crbug.com/672299 |
4585 image->draw(buf->canvas(), paint, destRect, srcRect, | 4585 image->draw(buf->canvas(), paint, destRect, srcRect, |
4586 DoNotRespectImageOrientation, Image::DoNotClampImageToSourceRect, | 4586 DoNotRespectImageOrientation, Image::DoNotClampImageToSourceRect, |
4587 ColorBehavior::transformToGlobalTarget()); | 4587 ColorBehavior::transformToGlobalTarget()); |
4588 return buf->newImageSnapshot(PreferNoAcceleration, | 4588 return buf->newImageSnapshot(PreferNoAcceleration, |
4589 SnapshotReasonWebGLDrawImageIntoBuffer); | 4589 SnapshotReasonWebGLDrawImageIntoBuffer); |
4590 } | 4590 } |
4591 | 4591 |
4592 WebGLTexture* WebGLRenderingContextBase::validateTexImageBinding( | 4592 WebGLTexture* WebGLRenderingContextBase::validateTexImageBinding( |
(...skipping 3234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7827 | 7827 |
7828 void WebGLRenderingContextBase::getHTMLOrOffscreenCanvas( | 7828 void WebGLRenderingContextBase::getHTMLOrOffscreenCanvas( |
7829 HTMLCanvasElementOrOffscreenCanvas& result) const { | 7829 HTMLCanvasElementOrOffscreenCanvas& result) const { |
7830 if (canvas()) | 7830 if (canvas()) |
7831 result.setHTMLCanvasElement(canvas()); | 7831 result.setHTMLCanvasElement(canvas()); |
7832 else | 7832 else |
7833 result.setOffscreenCanvas(offscreenCanvas()); | 7833 result.setOffscreenCanvas(offscreenCanvas()); |
7834 } | 7834 } |
7835 | 7835 |
7836 } // namespace blink | 7836 } // namespace blink |
OLD | NEW |