aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-08-20 19:22:38 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-08-20 19:22:38 +0000
commit0342a85091fd430c90a142d155dc9642aa729d9e (patch)
treead84edb6b6194b35ca77783c7147c2e62a56542f /src/gpu/gl
parentb7961193a3ecca44cf2650d9e446ebaa10b1583d (diff)
Remove _UPM_ GrPixelConfigs
Review URL: http://codereview.appspot.com/6460113/ git-svn-id: http://skia.googlecode.com/svn/trunk@5196 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu/gl')
-rw-r--r--src/gpu/gl/GrGLCaps.cpp2
-rw-r--r--src/gpu/gl/GrGpuGL.cpp33
-rw-r--r--src/gpu/gl/GrGpuGL_program.cpp4
3 files changed, 16 insertions, 23 deletions
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index 0afbe57319..2682eb2680 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -109,7 +109,7 @@ void GrGLCaps::init(const GrGLContextInfo& ctxInfo) {
fBGRAIsInternalFormat = true;
}
GrAssert(fBGRAFormatSupport ||
- kSkia8888_PM_GrPixelConfig != kBGRA_8888_PM_GrPixelConfig);
+ kSkia8888_GrPixelConfig != kBGRA_8888_GrPixelConfig);
}
if (kDesktop_GrGLBinding == binding) {
diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp
index 8089d100c2..03462e743b 100644
--- a/src/gpu/gl/GrGpuGL.cpp
+++ b/src/gpu/gl/GrGpuGL.cpp
@@ -335,18 +335,12 @@ void GrGpuGL::fillInConfigRenderableTable() {
fConfigRenderSupport[kRGBA_4444_GrPixelConfig] = true;
if (this->glCaps().rgba8RenderbufferSupport()) {
- fConfigRenderSupport[kRGBA_8888_PM_GrPixelConfig] = true;
+ fConfigRenderSupport[kRGBA_8888_GrPixelConfig] = true;
}
if (this->glCaps().bgraFormatSupport()) {
- fConfigRenderSupport[kBGRA_8888_PM_GrPixelConfig] = true;
+ fConfigRenderSupport[kBGRA_8888_GrPixelConfig] = true;
}
-
- // the un-premultiplied formats just inherit the premultiplied setting
- fConfigRenderSupport[kRGBA_8888_UPM_GrPixelConfig] =
- fConfigRenderSupport[kRGBA_8888_PM_GrPixelConfig];
- fConfigRenderSupport[kBGRA_8888_UPM_GrPixelConfig] =
- fConfigRenderSupport[kBGRA_8888_PM_GrPixelConfig];
}
bool GrGpuGL::canPreserveReadWriteUnpremulPixels() {
@@ -375,7 +369,7 @@ bool GrGpuGL::canPreserveReadWriteUnpremulPixels() {
kNoStencil_GrTextureFlagBit;
dstDesc.fWidth = 256;
dstDesc.fHeight = 256;
- dstDesc.fConfig = kRGBA_8888_PM_GrPixelConfig;
+ dstDesc.fConfig = kRGBA_8888_GrPixelConfig;
SkAutoTUnref<GrTexture> dstTex(this->createTexture(dstDesc, NULL, 0));
if (!dstTex.get()) {
@@ -397,16 +391,20 @@ bool GrGpuGL::canPreserveReadWriteUnpremulPixels() {
fUnpremulConversion = gMethods[i];
rt->writePixels(0, 0,
256, 256,
- kRGBA_8888_UPM_GrPixelConfig, srcData, 0);
+ kRGBA_8888_GrPixelConfig, srcData, 0,
+ GrContext::kUnpremul_PixelOpsFlag);
rt->readPixels(0, 0,
256, 256,
- kRGBA_8888_UPM_GrPixelConfig, firstRead, 0);
+ kRGBA_8888_GrPixelConfig, firstRead, 0,
+ GrContext::kUnpremul_PixelOpsFlag);
rt->writePixels(0, 0,
256, 256,
- kRGBA_8888_UPM_GrPixelConfig, firstRead, 0);
+ kRGBA_8888_GrPixelConfig, firstRead, 0,
+ GrContext::kUnpremul_PixelOpsFlag);
rt->readPixels(0, 0,
256, 256,
- kRGBA_8888_UPM_GrPixelConfig, secondRead, 0);
+ kRGBA_8888_GrPixelConfig, secondRead, 0,
+ GrContext::kUnpremul_PixelOpsFlag);
failed = false;
for (int j = 0; j < 256 * 256; ++j) {
if (firstRead[j] != secondRead[j]) {
@@ -1397,9 +1395,6 @@ void GrGpuGL::onClear(const GrIRect* rect, GrColor color) {
static const GrGLfloat scale255 = 1.f / 255.f;
a = GrColorUnpackA(color) * scale255;
GrGLfloat scaleRGB = scale255;
- if (GrPixelConfigIsUnpremultiplied(rt->config())) {
- scaleRGB *= a;
- }
r = GrColorUnpackR(color) * scaleRGB;
g = GrColorUnpackG(color) * scaleRGB;
b = GrColorUnpackB(color) * scaleRGB;
@@ -2321,8 +2316,7 @@ bool GrGpuGL::configToGLFormats(GrPixelConfig config,
}
switch (config) {
- case kRGBA_8888_PM_GrPixelConfig:
- case kRGBA_8888_UPM_GrPixelConfig:
+ case kRGBA_8888_GrPixelConfig:
*internalFormat = GR_GL_RGBA;
*externalFormat = GR_GL_RGBA;
if (getSizedInternalFormat) {
@@ -2332,8 +2326,7 @@ bool GrGpuGL::configToGLFormats(GrPixelConfig config,
}
*externalType = GR_GL_UNSIGNED_BYTE;
break;
- case kBGRA_8888_PM_GrPixelConfig:
- case kBGRA_8888_UPM_GrPixelConfig:
+ case kBGRA_8888_GrPixelConfig:
if (!this->glCaps().bgraFormatSupport()) {
return false;
}
diff --git a/src/gpu/gl/GrGpuGL_program.cpp b/src/gpu/gl/GrGpuGL_program.cpp
index c959f66b9a..c1eb36e9a7 100644
--- a/src/gpu/gl/GrGpuGL_program.cpp
+++ b/src/gpu/gl/GrGpuGL_program.cpp
@@ -733,7 +733,7 @@ void GrGpuGL::buildProgram(bool isPoints,
stage.fInConfigFlags |= StageDesc::kSwapRAndB_InConfigFlag;
}
}
- if (GrPixelConfigIsUnpremultiplied(texture->config())) {
+ if (sampler.premultiply()) {
// Assert that if we're doing a premul conversion that the texture is 1 byte
// per color component. The rounding performed by the shader generator (in
// normalized float color space) assumes this.
@@ -758,7 +758,7 @@ void GrGpuGL::buildProgram(bool isPoints,
}
}
- if (GrPixelConfigIsUnpremultiplied(drawState.getRenderTarget()->config())) {
+ if (drawState.isStateFlagEnabled(GrDrawState::kUnpremultiply_StageBit)) {
// The shader generator assumes that color channels are bytes
// when rounding.
GrAssert(4 == GrBytesPerPixel(drawState.getRenderTarget()->config()));