New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 639841 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Aug 2016
Cc:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug



Sign in to add a comment

Using a canvas with a bitmap as a drawImage source does not work.

Project Member Reported by zakerinasab@chromium.org, Aug 22 2016

Issue description

OS: Linux, probably others too

What steps will reproduce the problem?
(1) Load a bitmap to srcCanvas using srcContext.transferFromImageBitmap(image).
(2) Draw srcCanvas on dstCanvas using dstContext.drawImage(srcCanvas, 0, 0).

What is the expected output?
The destination canvas must be a copy of the source canvas.

What do you see instead?
The destination canvas is empty.


 

Comment 1 by junov@chromium.org, Aug 22 2016

Labels: -OS-Linux OS-All
Project Member

Comment 2 by bugdroid1@chromium.org, Aug 23 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/08fd30c773f566dc38208615abb801911808e215

commit 08fd30c773f566dc38208615abb801911808e215
Author: junov <junov@chromium.org>
Date: Tue Aug 23 01:07:30 2016

Ensure ImageBuffer is never used with ImageBitmapRenderingContext

When an HTMLCanvasElement has an ImageBitmapRenderingContext,
calling buffer() will return a buffer that is blank, which is
not the desired result, and triggers the lazy creation of an
persistent buffer that was never used.  This change adds a
DCHECK to catch improper uses, such ase the use case addressed by
https://codereview.chromium.org/2267653005/

BUG= 639841 

Review-Url: https://codereview.chromium.org/2262363002
Cr-Commit-Position: refs/heads/master@{#413614}

[modify] https://crrev.com/08fd30c773f566dc38208615abb801911808e215/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp

Project Member

Comment 4 by bugdroid1@chromium.org, Aug 23 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/061450ece090f8f8ad550cbe470dec03fbe5b487

commit 061450ece090f8f8ad550cbe470dec03fbe5b487
Author: xidachen <xidachen@chromium.org>
Date: Tue Aug 23 14:54:02 2016

Revert of Resolving drawImage issue with canvases that contain bitmap images (patchset #3 id:60001 of https://codereview.chromium.org/2267653005/ )

Reason for revert:
Causing this DCHECK:
m_context->getContextType() != CanvasRenderingContext::ContextImageBitmap

on this test:
transferFromImageBitmap-drawImage.html

Original issue's description:
> Adding proper check for canvas type to
> HTMLCanvasElement::getSourceImageForCanvas() such that
> drawImage can correctly draw canvases with bitmap images.
>
> BUG= 639841 
>
> Committed: https://crrev.com/4d29ebec048d83aac139ec5edcbe22d107351b7b
> Cr-Commit-Position: refs/heads/master@{#413731}

TBR=junov@chromium.org,zakerinasab@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG= 639841 

Review-Url: https://codereview.chromium.org/2269073002
Cr-Commit-Position: refs/heads/master@{#413737}

[delete] https://crrev.com/9e2e0f5824975f43ad9374ea5e97100b77925fc1/third_party/WebKit/LayoutTests/fast/canvas/imagebitmap/transferFromImageBitmap-drawImage.html
[modify] https://crrev.com/061450ece090f8f8ad550cbe470dec03fbe5b487/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
[modify] https://crrev.com/061450ece090f8f8ad550cbe470dec03fbe5b487/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.h
[modify] https://crrev.com/061450ece090f8f8ad550cbe470dec03fbe5b487/third_party/WebKit/Source/modules/imagebitmap/ImageBitmapRenderingContext.h

Status: Fixed (was: Untriaged)

Sign in to add a comment