More prep work in Gr for landing AA hairline renderer.
Review URL: http://codereview.appspot.com/4944045
git-svn-id: http://skia.googlecode.com/svn/trunk@2164 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gpu/src/GrContext.cpp b/gpu/src/GrContext.cpp
index 7bac3ba..6692023 100644
--- a/gpu/src/GrContext.cpp
+++ b/gpu/src/GrContext.cpp
@@ -551,7 +551,7 @@
///////////////////////////////////////////////////////////////////////////////
bool GrContext::supportsIndex8PixelConfig(const GrSamplerState& sampler,
- int width, int height) {
+ int width, int height) const {
if (!fGpu->supports8BitPalette()) {
return false;
}
@@ -639,7 +639,10 @@
if (!paint.fAntiAlias) {
return false;
}
- if (isHairLines && target->willUseHWAALines()) {
+ // Line primitves are always rasterized as 1 pixel wide.
+ // Super-sampling would make them too thin but MSAA would be OK.
+ if (isHairLines &&
+ (!PREFER_MSAA_OFFSCREEN_AA || !fGpu->supportsFullsceneAA())) {
return false;
}
if (target->getRenderTarget()->isMultisampled()) {
@@ -693,7 +696,7 @@
record->fScale = 1;
desc.fAALevel = kMed_GrAALevel;
} else {
- record->fDownsample = (fGpu->supports4x4DownsampleFilter()) ?
+ record->fDownsample = (fGpu->supportsShaders()) ?
OffscreenRecord::k4x4SinglePass_Downsample :
OffscreenRecord::k4x4TwoPass_Downsample;
record->fScale = OFFSCREEN_SSAA_SCALE;
@@ -1492,6 +1495,10 @@
////////////////////////////////////////////////////////////////////////////////
+bool GrContext::supportsShaders() const {
+ return fGpu->supportsShaders();
+}
+
void GrContext::flush(int flagsBitfield) {
if (kDiscard_FlushBit & flagsBitfield) {
fDrawBuffer->reset();