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

Issue 1763143002: WIP RasterCanvasLayerAllocator (Closed)

Created:
4 years, 9 months ago by tomhudson
Modified:
4 years, 2 months ago
Reviewers:
reed1
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@master
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

WIP Add SkRasterCanvasLayerAllocator Encapsulates allocating and freeing the raster backing for a canvas. Allows a client's subclass to provide a situationally-appropriate backing: a BITMAP on Windows, a CGBitmapContext on Mac, on Linux a cairo_surface_t. BUG=543755 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1763143002

Patch Set 1 #

Patch Set 2 : Buildability #

Patch Set 3 : Fix dependency #

Patch Set 4 : Avoid crashing #

Patch Set 5 : Avoid double-allocation of backing in SkBitmapDevice::onCreateDevice() #

Patch Set 6 : Remove unused SkCanvas::fNativeContext #

Patch Set 7 : Add allocator-constancy sanitycheck #

Total comments: 8

Patch Set 8 : test and some further work #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats (+275 lines, -20 lines) Patch
M gyp/core.gypi View 1 2 3 4 5 6 7 2 chunks +2 lines, -0 lines 0 comments Download
M include/core/SkBitmapDevice.h View 1 2 3 4 5 6 7 2 chunks +3 lines, -1 line 0 comments Download
M include/core/SkCanvas.h View 1 2 3 4 5 6 7 7 chunks +13 lines, -2 lines 2 comments Download
M include/core/SkDevice.h View 1 2 3 4 5 6 7 2 chunks +4 lines, -1 line 0 comments Download
A include/core/SkRasterCanvasLayerAllocator.h View 1 2 3 4 5 6 7 1 chunk +81 lines, -0 lines 3 comments Download
M src/core/SkBitmapDevice.cpp View 1 2 3 4 5 6 7 2 chunks +16 lines, -2 lines 0 comments Download
M src/core/SkCanvas.cpp View 1 2 3 4 5 6 7 18 chunks +48 lines, -9 lines 0 comments Download
A src/core/SkRasterCanvasLayerAllocator.cpp View 1 2 3 4 5 6 7 1 chunk +28 lines, -0 lines 0 comments Download
M src/gpu/SkGpuDevice.h View 1 2 3 4 5 6 7 3 chunks +4 lines, -2 lines 0 comments Download
M src/gpu/SkGpuDevice.cpp View 1 2 3 4 5 6 7 1 chunk +3 lines, -1 line 0 comments Download
M src/pdf/SkPDFDevice.h View 1 2 3 4 5 6 7 1 chunk +2 lines, -1 line 0 comments Download
M src/pdf/SkPDFDevice.cpp View 1 2 3 4 5 6 7 1 chunk +2 lines, -1 line 0 comments Download
A tests/LayerAllocatorTest.cpp View 1 2 3 4 5 6 7 1 chunk +69 lines, -0 lines 0 comments Download

Messages

Total messages: 11 (3 generated)
tomhudson
4 years, 7 months ago (2016-05-06 18:07:14 UTC) #4
tomhudson
Mike suggests we might want to replace getTopLayerNative() with an additional out parameter on accessTopLayerPixels().
4 years, 7 months ago (2016-05-11 15:14:12 UTC) #5
reed1
https://codereview.chromium.org/1763143002/diff/120001/include/core/SkCanvas.h File include/core/SkCanvas.h (right): https://codereview.chromium.org/1763143002/diff/120001/include/core/SkCanvas.h#newcode1519 include/core/SkCanvas.h:1519: SkRasterCanvasLayerAllocator* fAllocator; I presume we'll add a constructor that ...
4 years, 7 months ago (2016-05-11 18:58:25 UTC) #6
tomhudson
https://codereview.chromium.org/1763143002/diff/120001/include/core/SkCanvas.h File include/core/SkCanvas.h (right): https://codereview.chromium.org/1763143002/diff/120001/include/core/SkCanvas.h#newcode1519 include/core/SkCanvas.h:1519: SkRasterCanvasLayerAllocator* fAllocator; On 2016/05/11 18:58:24, reed1 wrote: > I ...
4 years, 7 months ago (2016-05-26 16:36:17 UTC) #7
tomhudson
Also forgot to mention: I expected saveLayer(nullptr, nullptr) to actually save a layer, because: @param ...
4 years, 7 months ago (2016-05-26 17:29:16 UTC) #8
reed1
saveLayer(nullptr, nullptr) should be working fine. https://fiddle.skia.org/c/2f5440e2492cd25f52f43945d059ea26
4 years, 5 months ago (2016-07-12 19:45:41 UTC) #9
reed1
https://codereview.chromium.org/1763143002/diff/140001/include/core/SkCanvas.h File include/core/SkCanvas.h (right): https://codereview.chromium.org/1763143002/diff/140001/include/core/SkCanvas.h#newcode1468 include/core/SkCanvas.h:1468: SkCanvas(const SkBitmap& bitmap, sk_sp<SkRasterCanvasLayerAllocator>); On 2016/05/26 16:36:17, tomhudson wrote: ...
4 years, 5 months ago (2016-07-12 19:52:40 UTC) #10
tomhudson
4 years, 2 months ago (2016-09-28 20:56:32 UTC) #11

Powered by Google App Engine
This is Rietveld 408576698