--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss+unsubscribe@googlegroups.com.
To post to this group, send email to skia-d...@googlegroups.com.
Visit this group at https://groups.google.com/group/skia-discuss.
For more options, visit https://groups.google.com/d/optout.
kN32 can be either RGBA or BGRA. If your system is defining it to be BGRA, then surface creation will fail.
On Fri, Jun 16, 2017 at 9:02 AM, 扈马克 <geoh...@gmail.com> wrote:
Hi all,
I'm a beginner with Skia. Writing my first program, I have the following code to create a SkSurface:
sk_sp<SkSurface> rasterSurface = SkSurface::MakeRasterN32Premul( imageWidth, imageHeight );
SkCanvas* rasterCanvas = rasterSurface->getCanvas();
.....
Unfortunately, rasterSurface always is a 0 pointer. Doing a bit of debugging, I find that in
SkSurfaceValidateRasterInfo(const SkImageInfo& info, size_t rowBytes), SkSurface_Raster.cpp:38, there is a switch depending on SkImageInfo.colorType(). It is kRGBA_8888_SkColorType and the program goes to the default-switch, returning false.
Is something in my code wrong or could it be that there is something wrong with my compilation (since kN32_SkColorType is assigned to a different value with a preprocessor if in SkImageInfo.h:82)?
If it is the compilation, I'm on kubuntu 17.04 and I'm using the following commands for checkout and compilation:
git clone 'https://chromium.googlesource.com/chromium/tools/depot_tools.git'
export PATH="${PWD}/depot_tools:${PATH}"
git clone https://skia.googlesource.com/skia.git
cd skia
python tools/git-sync-deps
bin/gn gen out/Shared --args='is_official_build=true is_component_build=true extra_cflags_cc=["-Wno-error"]'
ninja -C out/Shared
Thank you for any help/hints,
Marco
--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss+unsubscribe@googlegroups.com.
--
You received this message because you are subscribed to a topic in the Google Groups "skia-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/skia-discuss/oEmbjYTeT0k/unsubscribe.
To unsubscribe from this group and all its topics, send an email to skia-discuss+unsubscribe@googlegroups.com.
--