Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: Source/modules/webgl/WebGLRenderingContextBase.cpp

Issue 1334703002: NOT FOR LANDING Pass URL to Image::draw (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/modules/canvas2d/CanvasRenderingContext2D.cpp ('k') | Source/platform/DragImageTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 4122 matching lines...) Expand 10 before | Expand all | Expand 10 after
4133 IntSize size(width, height); 4133 IntSize size(width, height);
4134 ImageBuffer* buf = m_generatedImageCache.imageBuffer(size); 4134 ImageBuffer* buf = m_generatedImageCache.imageBuffer(size);
4135 if (!buf) { 4135 if (!buf) {
4136 synthesizeGLError(GL_OUT_OF_MEMORY, functionName, "out of memory"); 4136 synthesizeGLError(GL_OUT_OF_MEMORY, functionName, "out of memory");
4137 return nullptr; 4137 return nullptr;
4138 } 4138 }
4139 4139
4140 IntRect srcRect(IntPoint(), image->size()); 4140 IntRect srcRect(IntPoint(), image->size());
4141 IntRect destRect(0, 0, size.width(), size.height()); 4141 IntRect destRect(0, 0, size.width(), size.height());
4142 SkPaint paint; 4142 SkPaint paint;
4143 image->draw(buf->canvas(), paint, destRect, srcRect, DoNotRespectImageOrient ation, Image::DoNotClampImageToSourceRect); 4143 image->draw(buf->canvas(), paint, destRect, srcRect, DoNotRespectImageOrient ation, Image::DoNotClampImageToSourceRect, KURL()); // TODO(davve): empty url
4144 return buf->newImageSnapshot(); 4144 return buf->newImageSnapshot();
4145 } 4145 }
4146 4146
4147 void WebGLRenderingContextBase::texImage2D(GLenum target, GLint level, GLenum in ternalformat, 4147 void WebGLRenderingContextBase::texImage2D(GLenum target, GLint level, GLenum in ternalformat,
4148 GLsizei width, GLsizei height, GLint border, 4148 GLsizei width, GLsizei height, GLint border,
4149 GLenum format, GLenum type, DOMArrayBufferView* pixels) 4149 GLenum format, GLenum type, DOMArrayBufferView* pixels)
4150 { 4150 {
4151 if (isContextLost() || !validateTexFunc("texImage2D", NotTexSubImage2D, Sour ceArrayBufferView, target, level, internalformat, width, height, border, format, type, 0, 0) 4151 if (isContextLost() || !validateTexFunc("texImage2D", NotTexSubImage2D, Sour ceArrayBufferView, target, level, internalformat, width, height, border, format, type, 0, 0)
4152 || !validateTexFuncData("texImage2D", level, width, height, format, type , pixels, NullAllowed)) 4152 || !validateTexFuncData("texImage2D", level, width, height, format, type , pixels, NullAllowed))
4153 return; 4153 return;
(...skipping 2575 matching lines...) Expand 10 before | Expand all | Expand 10 after
6729 6729
6730 return totalBytesPerPixel; 6730 return totalBytesPerPixel;
6731 } 6731 }
6732 6732
6733 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const 6733 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const
6734 { 6734 {
6735 return m_drawingBuffer.get(); 6735 return m_drawingBuffer.get();
6736 } 6736 }
6737 6737
6738 } // namespace blink 6738 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/canvas2d/CanvasRenderingContext2D.cpp ('k') | Source/platform/DragImageTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698