fDoManualMipmapping = false;
fSRGBDecodeDisableSupport = false;
fSRGBDecodeDisableAffectsMipmaps = false;
+ fClearToOpaqueBlackIsBroken = false;
fBlitFramebufferFlags = kNoSupport_BlitFramebufferFlag;
fSRGBDecodeDisableAffectsMipmaps = fSRGBDecodeDisableSupport &&
kChromium_GrGLDriver != ctxInfo.driver();
+ // See http://crbug.com/710443
+#ifdef SK_BUILD_FOR_MAC
+ if (kIntel6xxx_GrGLRenderer == ctxInfo.renderer()) {
+ fClearToOpaqueBlackIsBroken = true;
+ }
+#endif
+
// Requires fTextureRedSupport, fTextureSwizzleSupport, msaa support, ES compatibility have
// already been detected.
this->initConfigTable(contextOptions, ctxInfo, gli, shaderCaps);
return fRGBAToBGRAReadbackConversionsAreSlow;
}
+ bool clearToOpaqueBlackIsBroken() const { return fClearToOpaqueBlackIsBroken; }
bool initDescForDstCopy(const GrRenderTargetProxy* src, GrSurfaceDesc* desc,
bool* rectsMustMatch, bool* disallowSubrect) const override;
bool fDoManualMipmapping : 1;
bool fSRGBDecodeDisableSupport : 1;
bool fSRGBDecodeDisableAffectsMipmaps : 1;
+ bool fClearToOpaqueBlackIsBroken : 1;
uint32_t fBlitFramebufferFlags;
#include "GrGLGpu.h"
+#include <cmath>
#include "../private/GrGLSL.h"
#include "GrBackendSurface.h"
#include "GrFixedClip.h"
GL_CALL(ColorMask(GR_GL_TRUE, GR_GL_TRUE, GR_GL_TRUE, GR_GL_TRUE));
fHWWriteToColor = kYes_TriState;
+
+ if (this->glCaps().clearToOpaqueBlackIsBroken() && 0 == r && 0 == g && 0 == b && 1 == a) {
+#ifdef SK_BUILD_FOR_ANDROID
+ // Android doesn't have std::nextafter but has nextafter.
+ static const GrGLfloat safeAlpha = nextafter(1.f, 2.f);
+#else
+ static const GrGLfloat safeAlpha = std::nextafter(1.f, 2.f);
+#endif
+ a = safeAlpha;
+ }
GL_CALL(ClearColor(r, g, b, a));
GL_CALL(Clear(GR_GL_COLOR_BUFFER_BIT));
}
}
}
}
+ int intelNumber;
+ n = sscanf(rendererString, "Intel(R) Iris(TM) Graphics %d", &intelNumber);
+ if (1 != n) {
+ n = sscanf(rendererString, "Intel(R) HD Graphics %d", &intelNumber);
+ }
+ if (1 == n) {
+ if (intelNumber >= 6000 && intelNumber < 7000) {
+ return kIntel6xxx_GrGLRenderer;
+ }
+ }
if (0 == strcmp("Mesa Offscreen", rendererString)) {
return kOSMesa_GrGLRenderer;
}
kAdreno4xx_GrGLRenderer,
kAdreno5xx_GrGLRenderer,
kOSMesa_GrGLRenderer,
+ /** Either HD 6xxx or Iris 6xxx */
+ kIntel6xxx_GrGLRenderer,
kOther_GrGLRenderer
};