* Caps specific to GrGLCaps
**************************************************************************/
- if (kES2_GrGLBinding == binding) {
+ if (kES_GrGLBinding == binding) {
GR_GL_GetIntegerv(gli, GR_GL_MAX_FRAGMENT_UNIFORM_VECTORS,
&fMaxFragmentUniformVectors);
} else {
ctxInfo.hasExtension("GL_ANGLE_pack_reverse_row_order");
}
- fTextureUsageSupport = (kES2_GrGLBinding == binding) &&
+ fTextureUsageSupport = (kES_GrGLBinding == binding) &&
ctxInfo.hasExtension("GL_ANGLE_texture_usage");
// Tex storage is in desktop 4.2 and can be an extension to desktop or ES.
// ES 2 only guarantees RGBA/uchar + one other format/type combo for
// ReadPixels. The other format has to checked at run-time since it
// can change based on which render target is bound
- fTwoFormatLimit = kES2_GrGLBinding == binding;
+ fTwoFormatLimit = kES_GrGLBinding == binding;
// Known issue on at least some Intel platforms:
// http://code.google.com/p/skia/issues/detail?id=946
fVertexArrayObjectSupport = ctxInfo.hasExtension("GL_OES_vertex_array_object");
}
- if (kES2_GrGLBinding == binding) {
+ if (kES_GrGLBinding == binding) {
if (ctxInfo.hasExtension("GL_EXT_shader_framebuffer_fetch")) {
fFBFetchType = kEXT_FBFetchType;
} else if (ctxInfo.hasExtension("GL_NV_shader_framebuffer_fetch")) {
// these functions are part of ES2, we assume they are available
// On the desktop we assume they are available if the extension
// is present or GL version is high enough.
- if (kES2_GrGLBinding == binding) {
+ if (kES_GrGLBinding == binding) {
if (NULL == fStencilFuncSeparate ||
NULL == fStencilMaskSeparate ||
NULL == fStencilOpSeparate) {
} else {
return k110_GrGLSLGeneration;
}
- case kES2_GrGLBinding:
+ case kES_GrGLBinding:
// version 1.00 of ES GLSL based on ver 1.20 of desktop GLSL
GrAssert(ver >= GR_GL_VER(1,00));
return k110_GrGLSLGeneration;
const char* GrGetGLSLVersionDecl(GrGLBinding binding, GrGLSLGeneration gen) {
switch (gen) {
case k110_GrGLSLGeneration:
- if (kES2_GrGLBinding == binding) {
+ if (kES_GrGLBinding == binding) {
// ES2s shader language is based on version 1.20 but is version
// 1.00 of the ES language.
return "#version 100\n";
if (!fCtxInfo.caps()->shaderDerivativeSupport()) {
return false;
}
- if (kES2_GrGLBinding == fCtxInfo.binding()) {
+ if (kES_GrGLBinding == fCtxInfo.binding()) {
this->addFSFeature(1 << kStandardDerivatives_GLSLFeature,
"GL_OES_standard_derivatives");
}
GrGLBinding binding,
SkString* str) {
// Desktop GLSL has added precision qualifiers but they don't do anything.
- if (kES2_GrGLBinding == binding) {
+ if (kES_GrGLBinding == binding) {
switch (p) {
case GrGLShaderVar::kHigh_Precision:
str->append("precision highp float;\n");
static const char* PrecisionString(Precision p, GrGLBinding binding) {
// Desktop GLSL has added precision qualifiers but they don't do anything.
- if (kES2_GrGLBinding == binding) {
+ if (kES_GrGLBinding == binding) {
switch (p) {
case kLow_Precision:
return "lowp ";
// check for ES2
n = sscanf(versionString, "OpenGL ES %d.%d", &major, &minor);
if (2 == n) {
- return kES2_GrGLBinding;
+ return kES_GrGLBinding;
}
return kNone_GrGLBinding;
}
if (kIndex_8_GrPixelConfig == srcConfig || kIndex_8_GrPixelConfig == texture->config()) {
return false;
}
- if (srcConfig != texture->config() && kES2_GrGLBinding == this->glBinding()) {
+ if (srcConfig != texture->config() && kES_GrGLBinding == this->glBinding()) {
// In general ES2 requires the internal format of the texture and the format of the src
// pixels to match. However, It may or may not be possible to upload BGRA data to a RGBA
// texture. It depends upon which extension added BGRA. The Apple extension allows it
!desc->fMSColorRenderbufferID ||
!this->configToGLFormats(desc->fConfig,
// GLES requires sized internal formats
- kES2_GrGLBinding == this->glBinding(),
+ kES_GrGLBinding == this->glBinding(),
&msColorFormat,
NULL,
NULL)) {
// Table 3.9 of the ES2 spec indicates the supported formats with CopyTexSubImage
// and BGRA isn't in the spec. There doesn't appear to be any extension that adds it. Perhaps
// many drivers would allow it to work, but ANGLE does not.
- if (kES2_GrGLBinding == gpu->glBinding() && gpu->glCaps().bgraIsInternalFormat() &&
+ if (kES_GrGLBinding == gpu->glBinding() && gpu->glCaps().bgraIsInternalFormat() &&
(kBGRA_8888_GrPixelConfig == dst->config() || kBGRA_8888_GrPixelConfig == src->config())) {
return false;
}
void GrGpuGL::initCopySurfaceDstDesc(const GrSurface* src, GrTextureDesc* desc) {
// Check for format issues with glCopyTexSubImage2D
- if (kES2_GrGLBinding == this->glBinding() && this->glCaps().bgraIsInternalFormat() &&
+ if (kES_GrGLBinding == this->glBinding() && this->glCaps().bgraIsInternalFormat() &&
kBGRA_8888_GrPixelConfig == src->config()) {
// glCopyTexSubImage2D doesn't work with this config. We'll want to make it a render target
// in order to call glBlitFramebuffer or to copy to it by rendering.
SK_GL(*this, BindFramebuffer(GR_GL_FRAMEBUFFER, fFBO));
SK_GL(*this, GenRenderbuffers(1, &fColorBufferID));
SK_GL(*this, BindRenderbuffer(GR_GL_RENDERBUFFER, fColorBufferID));
- if (kES2_GrGLBinding == bindingInUse) {
+ if (kES_GrGLBinding == bindingInUse) {
SK_GL(*this, RenderbufferStorage(GR_GL_RENDERBUFFER,
GR_GL_RGBA8,
width, height));
// in binding a packed format an FBO. However, we can't rely on packed
// depth stencil being available.
bool supportsPackedDepthStencil;
- if (kES2_GrGLBinding == bindingInUse) {
+ if (kES_GrGLBinding == bindingInUse) {
supportsPackedDepthStencil = this->hasExtension("GL_OES_packed_depth_stencil");
} else {
supportsPackedDepthStencil = version >= GR_GL_VER(3,0) ||
if (supportsPackedDepthStencil) {
// ES2 requires sized internal formats for RenderbufferStorage
// On Desktop we let the driver decide.
- GrGLenum format = kES2_GrGLBinding == bindingInUse ?
+ GrGLenum format = kES_GrGLBinding == bindingInUse ?
GR_GL_DEPTH24_STENCIL8 :
GR_GL_DEPTH_STENCIL;
SK_GL(*this, RenderbufferStorage(GR_GL_RENDERBUFFER,
GR_GL_RENDERBUFFER,
fDepthStencilBufferID));
} else {
- GrGLenum format = kES2_GrGLBinding == bindingInUse ?
+ GrGLenum format = kES_GrGLBinding == bindingInUse ?
GR_GL_STENCIL_INDEX8 :
GR_GL_STENCIL_INDEX;
SK_GL(*this, RenderbufferStorage(GR_GL_RENDERBUFFER,
static SkAutoTUnref<GrGLInterface> glInterface;
if (!glInterface.get()) {
GrGLExtensions extensions;
- if (!extensions.init(kES2_GrGLBinding, glGetString, NULL, glGetIntegerv)) {
+ if (!extensions.init(kES_GrGLBinding, glGetString, NULL, glGetIntegerv)) {
return NULL;
}
GrGLInterface* interface = new GrGLInterface;
glInterface.reset(interface);
- interface->fBindingsExported = kES2_GrGLBinding;
+ interface->fBindingsExported = kES_GrGLBinding;
interface->fActiveTexture = glActiveTexture;
interface->fAttachShader = glAttachShader;
interface->fBindAttribLocation = glBindAttribLocation;
if (!glInterface.get()) {
GrGLInterface* interface = new GrGLInterface;
glInterface.reset(interface);
- interface->fBindingsExported = kES2_GrGLBinding;
+ interface->fBindingsExported = kES_GrGLBinding;
GET_PROC(ActiveTexture);
GET_PROC(AttachShader);
interface->fGenVertexArrays = glGenVertexArraysOES;
#endif
- interface->fBindingsExported = kES2_GrGLBinding;
+ interface->fBindingsExported = kES_GrGLBinding;
}
glInterface.get()->ref();
return glInterface.get();