[Webkit-unassigned] [Bug 30909] 10.6 SDK building for 10.5: GraphicsContextCG.cpp:1056: warning: enumeration value 'kCGInterpolationMedium' not handled in switch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Wed Nov 4 06:30:36 PST 2009
https://bugs.webkit.org/show_bug.cgi?id=30909
--- Comment #26 from Mark Mentovai <mark at chromium.org> 2009-11-04 06:30:34 PDT ---
(In reply to comment #25)
> CoreGraphics is well above the Darwin layer so it’s odd to suggest that Darwin
> is somehow relevant to this decision.
The original code used PLATFORM(MAC), which suggested that
kCGInterpolationMedium is not available on Windows. It also suggested that
kCGInterpolationMedium was not available to Mac Chromium, which was an
incorrect assumption.
Since this is a CG file, it's being built on Darwin, I figured it'd be safe to
assume that the presence and usability of kCGInterpolationMedium could be gated
on the headers and the target. If building on Darwin but not PLATFORM(MAC) and
not USE(CG), then this file won't be seen at all.
Here's another option:
#if (PLATFORM(MAC) || (PLATFORM(CHROMIUM) && PLATFORM(DARWIN)) &&
!defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
but it's starting to get really verbose there, and it's still not strictly
right, because there might be other "platforms" beyond MAC and CHROMIUM+DARWIN
that run on the Mac and use Mac-style CG.
This is a pattern that comes up for Chromium a lot, and it seems like we need
to rehash it each and every time, without any real consensus on how to treat
it. What do you prefer, Mark?
> > @@ -1061,9 +1067,15 @@ InterpolationQuality GraphicsContext::im
> > case kCGInterpolationLow:
> > return InterpolationLow;
> > #if HAVE(CG_INTERPOLATION_MEDIUM)
> > + // kCGInterpolationMedium is known to be present in the CGInterpolationQuality enum.
> > case kCGInterpolationMedium:
> > +#if USE(CG_INTERPOLATION_MEDIUM)
> > + // Only map to InterpolationMedium if targeting a system that understands it.
> > return InterpolationMedium;
> > -#endif
> > +#else
> > + return InterpolationDefault;
> > +#endif // USE(CG_INTERPOLATION_MEDIUM)
> > +#endif // HAVE(CG_INTERPOLATION_MEDIUM)
> > case kCGInterpolationHigh:
> > return InterpolationHigh;
> > }
>
> It’s surprising to me that the !USE(CG_INTERPOLATION_MEDIUM) case returns
> InterpolationDefault while !HAVE(CG_INTERPOLATION_MEDIUM) returns
> InterpolationHigh. Is there some reason for that difference?
I don't think that's the case.
Given kCGInterpolationMedium:
HAVE USE RESULT
true true InterpolationMedium
true false InterpolationDefault
false true InterpolationDefault
false false InterpolationDefault
I think you may be taking the patch out of context. If !HAVE, and
kCGInterpolationMedium is encountered at runtime, none of the cases in this
switch will be matched, and flow will fall through to the |return
InterpolationDefault;| outside of the switch body. This is not shown in the
diff, which missed it by one line.
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list