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

Issue 719664 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: May 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug

Blocking:
issue 667431



Sign in to add a comment

color: Crash when rendering canvas with gpu raster

Project Member Reported by ccameron@chromium.org, May 8 2017

Issue description

OS: Only tested on Mac so far

What steps will reproduce the problem?
(1) Run with --enable-gpu-rasterization and --enable-color-correct-rendering
(2) Open the attached canvas.html (with the .png loaded in the same path).
(3) Crash

This crash does not happen when GPU rasterization is disabled. 

The stack of the crash is as follows

21251', stop reason = EXC_BAD_ACCESS (code=1, address=0x28)
    frame #0: 0x0000000126cdec7c libskia.dylib`GrContext::resourceProvider(this=0x0000000000000000)
   234      GrAtlasGlyphCache* getAtlasGlyphCache() { return fAtlasGlyphCache; }
   235      GrTextBlobCache* getTextBlobCache() { return fTextBlobCache.get(); }
   236      bool abandoned() const;
-> 237      GrResourceProvider* resourceProvider() { return fResourceProvider; }
   238      const GrResourceProvider* resourceProvider() const { return fResourceProvider; }
   239      GrResourceCache* getResourceCache() { return fResourceCache; }
   240  
(lldb) bt
* thread #10: tid = 0x114e02, 0x0000000126cdec7c libskia.dylib`GrContext::resourceProvider(this=0x0000000000000000)
  * rContext::resourceProvider(this=0x0000000000000000)
    rContext::makeDeferredRenderTargetContext(this=0x0000000000000000, fit=kExact, width=256, height=256, config=kRGBA_8888_GrPixelConfig, colorSpace=sk_sp<SkColorSpace> @ 0x00007000047879f8, sampleCnt=0, origin=kBottomLeft_GrSurfaceOrigin, surfaceProps=0x0000000000000000, budgeted=1)
    kImage_Gpu::onMakeColorSpace(this=0x00007ffa6094e5b0, colorSpace=sk_sp<SkColorSpace> @ 0x0000700004787b38, (null)=kBGRA_8888_SkColorType, premulBehavior=kIgnore) const
    kImage::makeColorSpace(this=0x00007ffa6094e5b0, target=sk_sp<SkColorSpace> @ 0x0000700004787bc0, premulBehavior=kIgnore) const
    kColorSpaceXformer::apply(this=0x00007ffa6094d3f0, src=0x00007ffa6094e5b0)
    kColorSpaceXformCanvas::onDrawImageRect(this=0x00007ffa61886400, img=0x00007ffa6094e5b0, src=0x0000700004787db8, dst=0x0000700004787eb8, paint=0x0000700004787fe0, constraint=kStrict_SrcRectConstraint)
    kCanvas::drawImageRect(this=0x00007ffa61886400, image=0x00007ffa6094e5b0, src=0x0000700004787db8, dst=0x0000700004787eb8, paint=0x0000700004787fe0, constraint=kStrict_SrcRectConstraint)
    kCanvas::drawImageRect(this=0x00007ffa61886400, image=0x00007ffa6094e5b0, isrc=0x00007ffa6094e508, dst=0x0000700004787eb8, paint=0x0000700004787fe0, constraint=kStrict_SrcRectConstraint)
    kCanvas::drawImageRect(this=0x00007ffa61886400, image=0x0000700004787eb0, isrc=0x00007ffa6094e508, dst=0x0000700004787eb8, paint=0x0000700004787fe0, cons=kStrict_SrcRectConstraint)
    kSpecialImage_Gpu::onDraw(this=0x00007ffa6094e4f0, canvas=0x00007ffa61886400, x=0, y=0, paint=0x0000700004787fe0) const
    SkSpecialImage::draw(this=0x00007ffa6094e4f0, canvas=0x00007ffa61886400, x=0, y=0, paint=0x0000700004787fe0) const
    SkPictureImageFilter::drawPictureAtLocalResolution(this=0x00007ffa6094cdc0, source=0x00007ffa6094d0b0, canvas=0x00007ffa61886400, deviceBounds=0x0000700004788380, ctx=0x00007000047885d8) const
    SkPictureImageFilter::onFilterImage(this=0x00007ffa6094cdc0, source=0x00007ffa6094d0b0, ctx=0x00007000047885d8, offset=0x00007000047888f0) const
    SkImageFilter::filterImage(this=0x00007ffa6094cdc0, src=0x00007ffa6094d0b0, context=0x00007000047885d8, offset=0x00007000047888f0) const
    SkGpuDevice::filterTexture(this=0x00007ffa6187f000, srcImg=0x00007ffa6094d0b0, left=18, top=18, offset=0x00007000047888f0, filter=0x00007ffa6094cdc0)
    SkGpuDevice::drawSpecial(this=0x00007ffa6187f000, special1=0x00007ffa6094d0b0, left=18, top=18, paint=0x00007ffa6094c3d0, clipImage=0x0000000000000000, clipMatrix=0x00007ffa6094d088)
    SkCanvas::internalDrawDevice(this=0x00007ffa6187fc00, srcDev=0x00007ffa61883000, x=18, y=18, paint=0x00007ffa6094c3d0, clipImage=0x0000000000000000, clipMatrix=0x00007ffa6094d088)
    SkCanvas::internalRestore(this=0x00007ffa6187fc00)
    SkCanvas::restore(this=0x00007ffa6187fc00)
    SkColorSpaceXformCanvas::willRestore(this=0x00007ffa61880e00)
    SkCanvas::restore(this=0x00007ffa61880e00)
    libcc_paint.dylib`cc::RestoreOp::Raster(base_op=0x00007ffa60985b38, canvas=0x00007ffa61880e00, original_ctm=0x0000700004788f40)

 
Cc: brianosman@chromium.org
We may be specifying an invalid blink::ColorBehavior here -- I'm taking a look at that angle ATM.
AFAICT, the inputs are valid, but I could be missing something.
This is a bug in some of the GPU related helper methods on the xform canvas. getGrContext() is the particular problem here - it returns nullptr, rather than the GrContext of the wrapped canvas.
Project Member

Comment 5 by bugdroid1@chromium.org, May 9 2017

The following revision refers to this bug:
  https://skia.googlesource.com/skia/+/d2da87d0b8d127da0530c661618f059eb1cc0f1e

commit d2da87d0b8d127da0530c661618f059eb1cc0f1e
Author: Brian Osman <brianosman@google.com>
Date: Tue May 09 03:52:04 2017

Forward getGrContext in color space xform canvas

Bug:  chromium:719664 
Change-Id: I7477c1eb0479d5305233dc6a643280d88029bd17
Reviewed-on: https://skia-review.googlesource.com/15888
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>

[modify] https://crrev.com/d2da87d0b8d127da0530c661618f059eb1cc0f1e/include/core/SkCanvas.h
[modify] https://crrev.com/d2da87d0b8d127da0530c661618f059eb1cc0f1e/src/core/SkColorSpaceXformCanvas.cpp

Blocking: 667431
Thanks for the sub-millisecond response on this!
Is this fixed?
Status: Fixed (was: Assigned)
Yes, closing!

Sign in to add a comment