Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 06 May 2018 18:04:33 +0000
From:      bugzilla-noreply@freebsd.org
To:        chromium@FreeBSD.org
Subject:   [Bug 227915] www/chromium: fails to build with graphics/jpeg
Message-ID:  <bug-227915-28929-f3RSIAlu9m@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-227915-28929@https.bugs.freebsd.org/bugzilla/>
References:  <bug-227915-28929@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D227915

--- Comment #7 from gja822@narod.ru ---
Comment on attachment 193108
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D193108
for compilation with graphics/jpeg

>--- SkJpegCodec.cpp_o	2018-05-07 00:18:31.461277000 +0700
>+++ /usr/ports/www/chromium/work/chromium-65.0.3325.181/third_party/skia/s=
rc/codec/SkJpegCodec.cpp	2018-05-07 00:34:58.580849000 +0700
>@@ -305,10 +305,14 @@ SkJpegCodec::SkJpegCodec(int width, int=20
> /*
>  * Return the row bytes of a particular image type and width
>  */
> static size_t get_row_bytes(const j_decompress_ptr dinfo) {
>-    const size_t colorBytes =3D (dinfo->out_color_space =3D=3D JCS_RGB565=
) ? 2 :
>+    const size_t colorBytes =3D=20
>+#ifdef JCS_EXTENSIONS
>+    (dinfo->out_color_space =3D=3D JCS_RGB565) ? 2 :
>+#endif
>             dinfo->out_color_components;
>+
>     return dinfo->output_width * colorBytes;
>=20
> }
>=20
>@@ -396,8 +400,9 @@ bool SkJpegCodec::setOutputColorSpace(co
>=20
>     J_COLOR_SPACE encodedColorType =3D fDecoderMgr->dinfo()->jpeg_color_s=
pace;
>=20
>     // Check for valid color types and set the output color space
>+#ifdef JCS_EXTENSIONS
>     switch (dstInfo.colorType()) {
>         case kRGBA_8888_SkColorType:
>             fDecoderMgr->dinfo()->out_color_space =3D JCS_EXT_RGBA;
>             break;
>@@ -436,8 +441,39 @@ bool SkJpegCodec::setOutputColorSpace(co
>             break;
>         default:
>             return false;
>     }
>+#else
>+    if (dstInfo.colorType() =3D=3D kGray_8_SkColorType) {
>+	if (this->colorXform() || JCS_GRAYSCALE !=3D encodedColorType) {
>+                return false;
>+            }
>+
>+        fDecoderMgr->dinfo()->out_color_space =3D JCS_GRAYSCALE;
>+    }
>+    else
>+	if ((dstInfo.colorType() =3D=3D kGray_8_SkColorType) ||
>+    	    (dstInfo.colorType() =3D=3D kBGRA_8888_SkColorType) ||
>+    	    (dstInfo.colorType() =3D=3D kRGB_565_SkColorType) ) {
>+    	    fDecoderMgr->dinfo()->out_color_space =3D JCS_RGB;
>+    	}
>+    	else
>+    	if (dstInfo.colorType() =3D=3D kRGBA_F16_SkColorType)
>+    	{
>+    	    SkASSERT(this->colorXform());
>+
>+            if (!dstInfo.colorSpace()->gammaIsLinear()) {
>+                return false;
>+            }
>+
>+            fDecoderMgr->dinfo()->out_color_space =3D JCS_RGB;
>+    	}
>+    	else
>+    	{
>+    	    return false;
>+    	}
>+    }
>+#endif
>=20
>     // Check if we will decode to CMYK.  libjpeg-turbo does not convert C=
MYK to RGBA, so
>     // we must do it ourselves.
>     if (JCS_CMYK =3D=3D encodedColorType || JCS_YCCK =3D=3D encodedColorT=
ype) {
>@@ -711,9 +747,11 @@ SkCodec::Result SkJpegCodec::onStartScan
>         // block size.  If this is the case, it will decrease the value of
>         // startX to the appropriate alignment and also increase the value
>         // of width so that the right edge of the requested subset remains
>         // the same.
>+#ifdef JCS_EXTENSIONS
>         jpeg_crop_scanline(fDecoderMgr->dinfo(), &startX, &width);
>+#endif
>=20
>         SkASSERT(startX <=3D (uint32_t) options.fSubset->x());
>         SkASSERT(width >=3D (uint32_t) options.fSubset->width());
>         SkASSERT(startX + width >=3D (uint32_t) options.fSubset->right());
>@@ -762,13 +800,17 @@ int SkJpegCodec::onGetScanlines(void* ds
>=20
> bool SkJpegCodec::onSkipScanlines(int count) {
>     // Set the jump location for libjpeg errors
>     skjpeg_error_mgr::AutoPushJmpBuf jmp(fDecoderMgr->errorMgr());
>+#ifdef JCS_EXTENSIONS
>     if (setjmp(jmp)) {
>         return fDecoderMgr->returnFalse("onSkipScanlines");
>     }
>=20
>     return (uint32_t) count =3D=3D jpeg_skip_scanlines(fDecoderMgr->dinfo=
(), count);
>+#else
>+    return fDecoderMgr->returnFalse("onSkipScanlines");
>+#endif
> }
>=20
> static bool is_yuv_supported(jpeg_decompress_struct* dinfo) {
>     // Scaling is not supported in raw data mode.

--=20
You are receiving this mail because:
You are on the CC list for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-227915-28929-f3RSIAlu9m>