Remove unneeded #define
Review URL: http://codereview.appspot.com/4973053/ git-svn-id: http://skia.googlecode.com/svn/trunk@2213 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
d16872c21f
commit
973b879dfd
@ -505,13 +505,6 @@ enum GrPlatformSurfaceType {
|
|||||||
enum GrPlatformRenderTargetFlags {
|
enum GrPlatformRenderTargetFlags {
|
||||||
kNone_GrPlatformRenderTargetFlagBit = 0x0,
|
kNone_GrPlatformRenderTargetFlagBit = 0x0,
|
||||||
|
|
||||||
/**
|
|
||||||
* Specifies that the object being created is multisampled.
|
|
||||||
* WILL BE REMOVED ONCE WEBKIT STOPS USING THIS. INSTEAD
|
|
||||||
* SPECIFY # OF SAMPLES IN GrPlatformSurfaceDesc::fSampleCnt
|
|
||||||
*/
|
|
||||||
kIsMultisampled_GrPlatformRenderTargetFlagBit = 0x1,
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gives permission to Gr to perform the downsample-resolve of a
|
* Gives permission to Gr to perform the downsample-resolve of a
|
||||||
* multisampled render target. If this is not set then read pixel
|
* multisampled render target. If this is not set then read pixel
|
||||||
|
@ -522,29 +522,17 @@ GrResource* GrContext::createPlatformSurface(const GrPlatformSurfaceDesc& desc)
|
|||||||
// validate flags here so that GrGpu subclasses don't have to check
|
// validate flags here so that GrGpu subclasses don't have to check
|
||||||
if (kTexture_GrPlatformSurfaceType == desc.fSurfaceType &&
|
if (kTexture_GrPlatformSurfaceType == desc.fSurfaceType &&
|
||||||
0 != desc.fRenderTargetFlags) {
|
0 != desc.fRenderTargetFlags) {
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
#if !GR_USE_PLATFORM_CREATE_SAMPLE_COUNT
|
|
||||||
if (!(kIsMultisampled_GrPlatformRenderTargetFlagBit & desc.fRenderTargetFlags) &&
|
|
||||||
(kGrCanResolve_GrPlatformRenderTargetFlagBit & desc.fRenderTargetFlags)) {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
if (kTextureRenderTarget_GrPlatformSurfaceType == desc.fSurfaceType &&
|
|
||||||
(kIsMultisampled_GrPlatformRenderTargetFlagBit & desc.fRenderTargetFlags) &&
|
|
||||||
!(kGrCanResolve_GrPlatformRenderTargetFlagBit & desc.fRenderTargetFlags)) {
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
if (desc.fSampleCnt &&
|
if (desc.fSampleCnt &&
|
||||||
(kGrCanResolve_GrPlatformRenderTargetFlagBit & desc.fRenderTargetFlags)) {
|
(kGrCanResolve_GrPlatformRenderTargetFlagBit & desc.fRenderTargetFlags)) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (kTextureRenderTarget_GrPlatformSurfaceType == desc.fSurfaceType &&
|
if (kTextureRenderTarget_GrPlatformSurfaceType == desc.fSurfaceType &&
|
||||||
desc.fSampleCnt &&
|
desc.fSampleCnt &&
|
||||||
!(kGrCanResolve_GrPlatformRenderTargetFlagBit & desc.fRenderTargetFlags)) {
|
!(kGrCanResolve_GrPlatformRenderTargetFlagBit & desc.fRenderTargetFlags)) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
return fGpu->createPlatformSurface(desc);
|
return fGpu->createPlatformSurface(desc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -626,11 +626,7 @@ GrResource* GrGpuGL::onCreatePlatformSurface(const GrPlatformSurfaceDesc& desc)
|
|||||||
if (isRenderTarget) {
|
if (isRenderTarget) {
|
||||||
rtDesc.fRTFBOID = desc.fPlatformRenderTarget;
|
rtDesc.fRTFBOID = desc.fPlatformRenderTarget;
|
||||||
rtDesc.fConfig = desc.fConfig;
|
rtDesc.fConfig = desc.fConfig;
|
||||||
#if GR_USE_PLATFORM_CREATE_SAMPLE_COUNT
|
|
||||||
if (desc.fSampleCnt) {
|
if (desc.fSampleCnt) {
|
||||||
#else
|
|
||||||
if (kIsMultisampled_GrPlatformRenderTargetFlagBit & desc.fRenderTargetFlags) {
|
|
||||||
#endif
|
|
||||||
if (kGrCanResolve_GrPlatformRenderTargetFlagBit & desc.fRenderTargetFlags) {
|
if (kGrCanResolve_GrPlatformRenderTargetFlagBit & desc.fRenderTargetFlags) {
|
||||||
rtDesc.fTexFBOID = desc.fPlatformResolveDestination;
|
rtDesc.fTexFBOID = desc.fPlatformResolveDestination;
|
||||||
} else {
|
} else {
|
||||||
@ -643,18 +639,7 @@ GrResource* GrGpuGL::onCreatePlatformSurface(const GrPlatformSurfaceDesc& desc)
|
|||||||
// we don't know what the RB ids are without glGets and we don't care
|
// we don't know what the RB ids are without glGets and we don't care
|
||||||
// since we aren't responsible for deleting them.
|
// since we aren't responsible for deleting them.
|
||||||
rtDesc.fMSColorRenderbufferID = 0;
|
rtDesc.fMSColorRenderbufferID = 0;
|
||||||
#if GR_USE_PLATFORM_CREATE_SAMPLE_COUNT
|
|
||||||
rtDesc.fSampleCnt = desc.fSampleCnt;
|
rtDesc.fSampleCnt = desc.fSampleCnt;
|
||||||
#else
|
|
||||||
if (kIsMultisampled_GrPlatformRenderTargetFlagBit & desc.fRenderTargetFlags) {
|
|
||||||
// just guess, this code path is only compiled in WK and we aren't
|
|
||||||
// using MSAA anyway. This will be stripped out soon when WK sets
|
|
||||||
// the fSampleCnt in GrPlatformSurfaceDesc.
|
|
||||||
rtDesc.fSampleCnt = 4;
|
|
||||||
} else {
|
|
||||||
rtDesc.fSampleCnt = 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
if (desc.fStencilBits) {
|
if (desc.fStencilBits) {
|
||||||
GrGLStencilBuffer::Format format;
|
GrGLStencilBuffer::Format format;
|
||||||
format.fInternalFormat = GrGLStencilBuffer::kUnknownInternalFormat;
|
format.fInternalFormat = GrGLStencilBuffer::kUnknownInternalFormat;
|
||||||
|
@ -208,7 +208,6 @@
|
|||||||
],
|
],
|
||||||
'defines': [
|
'defines': [
|
||||||
'GR_IMPLEMENTATION=1',
|
'GR_IMPLEMENTATION=1',
|
||||||
'GR_USE_PLATFORM_CREATE_SAMPLE_COUNT=1',
|
|
||||||
],
|
],
|
||||||
'conditions': [
|
'conditions': [
|
||||||
[ 'skia_os == "linux"', {
|
[ 'skia_os == "linux"', {
|
||||||
|
Loading…
Reference in New Issue
Block a user