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 4572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4583 if (!buf) { | 4583 if (!buf) { |
4584 synthesizeGLError(GL_OUT_OF_MEMORY, functionName, "out of memory"); | 4584 synthesizeGLError(GL_OUT_OF_MEMORY, functionName, "out of memory"); |
4585 return nullptr; | 4585 return nullptr; |
4586 } | 4586 } |
4587 | 4587 |
4588 if (!image->currentFrameKnownToBeOpaque()) | 4588 if (!image->currentFrameKnownToBeOpaque()) |
4589 buf->canvas()->clear(SK_ColorTRANSPARENT); | 4589 buf->canvas()->clear(SK_ColorTRANSPARENT); |
4590 | 4590 |
4591 IntRect srcRect(IntPoint(), image->size()); | 4591 IntRect srcRect(IntPoint(), image->size()); |
4592 IntRect destRect(0, 0, size.width(), size.height()); | 4592 IntRect destRect(0, 0, size.width(), size.height()); |
4593 SkPaint paint; | 4593 PaintFlags paint; |
4594 // TODO(ccameron): WebGL should produce sRGB images. | 4594 // TODO(ccameron): WebGL should produce sRGB images. |
4595 // https://crbug.com/672299 | 4595 // https://crbug.com/672299 |
4596 image->draw(buf->canvas(), paint, destRect, srcRect, | 4596 image->draw(buf->canvas(), paint, destRect, srcRect, |
4597 DoNotRespectImageOrientation, Image::DoNotClampImageToSourceRect, | 4597 DoNotRespectImageOrientation, Image::DoNotClampImageToSourceRect, |
4598 ColorBehavior::transformToGlobalTarget()); | 4598 ColorBehavior::transformToGlobalTarget()); |
4599 return buf->newImageSnapshot(PreferNoAcceleration, | 4599 return buf->newImageSnapshot(PreferNoAcceleration, |
4600 SnapshotReasonWebGLDrawImageIntoBuffer); | 4600 SnapshotReasonWebGLDrawImageIntoBuffer); |
4601 } | 4601 } |
4602 | 4602 |
4603 WebGLTexture* WebGLRenderingContextBase::validateTexImageBinding( | 4603 WebGLTexture* WebGLRenderingContextBase::validateTexImageBinding( |
(...skipping 3234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7838 | 7838 |
7839 void WebGLRenderingContextBase::getHTMLOrOffscreenCanvas( | 7839 void WebGLRenderingContextBase::getHTMLOrOffscreenCanvas( |
7840 HTMLCanvasElementOrOffscreenCanvas& result) const { | 7840 HTMLCanvasElementOrOffscreenCanvas& result) const { |
7841 if (canvas()) | 7841 if (canvas()) |
7842 result.setHTMLCanvasElement(canvas()); | 7842 result.setHTMLCanvasElement(canvas()); |
7843 else | 7843 else |
7844 result.setOffscreenCanvas(offscreenCanvas()); | 7844 result.setOffscreenCanvas(offscreenCanvas()); |
7845 } | 7845 } |
7846 | 7846 |
7847 } // namespace blink | 7847 } // namespace blink |
OLD | NEW |