aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu
diff options
context:
space:
mode:
authorGravatar reed <reed@chromium.org>2014-09-21 10:25:07 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-09-21 10:25:07 -0700
commit29c857d0f3a1cb837f73406eeb6ba9771879b5e7 (patch)
tree135d517cf36f82b7f6f02fd81bfef92eb8befe34 /src/gpu
parent3716fd067a5621bb94a6cb08d72afec8bf3aceda (diff)
Revert of introduce Props to surface (patchset #27 id:520001 of https://codereview.chromium.org/551463004/)
Reason for revert: Broke call site in WebKit Original issue's description: > introduce Props to surface (work in progress) > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/3716fd067a5621bb94a6cb08d72afec8bf3aceda R=robertphillips@google.com, bsalomon@google.com, jvanverth@google.com, bungeman@google.com, fmalita@google.com, vangelis@chromium.org, reed@google.com TBR=bsalomon@google.com, bungeman@google.com, fmalita@google.com, jvanverth@google.com, reed@google.com, robertphillips@google.com, vangelis@chromium.org NOTREECHECKS=true NOTRY=true BUG=skia: Author: reed@chromium.org Review URL: https://codereview.chromium.org/583773004
Diffstat (limited to 'src/gpu')
-rwxr-xr-xsrc/gpu/GrDistanceFieldTextContext.cpp9
-rw-r--r--src/gpu/GrLayerHoister.cpp6
-rw-r--r--src/gpu/SkGpuDevice.cpp18
-rw-r--r--src/gpu/SkGpuDevice.h9
4 files changed, 21 insertions, 21 deletions
diff --git a/src/gpu/GrDistanceFieldTextContext.cpp b/src/gpu/GrDistanceFieldTextContext.cpp
index df07204fcb..313c02ac51 100755
--- a/src/gpu/GrDistanceFieldTextContext.cpp
+++ b/src/gpu/GrDistanceFieldTextContext.cpp
@@ -131,7 +131,8 @@ void GrDistanceFieldTextContext::setupCoverageEffect(const SkColor& filteredColo
flags |= fUseLCDText ? kUseLCD_DistanceFieldEffectFlag : 0;
flags |= fUseLCDText && fTextMatrix.rectStaysRect() ?
kRectToRect_DistanceFieldEffectFlag : 0;
- bool useBGR = SkPixelGeometryIsBGR(fDeviceProperties.fPixelGeometry);
+ bool useBGR = SkDeviceProperties::Geometry::kBGR_Layout ==
+ fDeviceProperties.fGeometry.getLayout();
flags |= fUseLCDText && useBGR ? kBGR_DistanceFieldEffectFlag : 0;
// see if we need to create a new effect
@@ -148,7 +149,7 @@ void GrDistanceFieldTextContext::setupCoverageEffect(const SkColor& filteredColo
flags));
} else {
#ifdef SK_GAMMA_APPLY_TO_A8
- U8CPU lum = SkColorSpaceLuminance::computeLuminance(fDeviceProperties.getGamma(),
+ U8CPU lum = SkColorSpaceLuminance::computeLuminance(fDeviceProperties.fGamma,
filteredColor);
fCachedEffect.reset(GrDistanceFieldTextureEffect::Create(fCurrTexture,
params,
@@ -501,8 +502,8 @@ static void setup_gamma_texture(GrContext* context, const SkGlyphCache* cache,
#else
SkScalar contrast = 0.5f;
#endif
- SkScalar paintGamma = deviceProperties.getGamma();
- SkScalar deviceGamma = deviceProperties.getGamma();
+ SkScalar paintGamma = deviceProperties.fGamma;
+ SkScalar deviceGamma = deviceProperties.fGamma;
size = SkScalerContext::GetGammaLUTSize(contrast, paintGamma, deviceGamma,
&width, &height);
diff --git a/src/gpu/GrLayerHoister.cpp b/src/gpu/GrLayerHoister.cpp
index 165716f82d..ba431d33e9 100644
--- a/src/gpu/GrLayerHoister.cpp
+++ b/src/gpu/GrLayerHoister.cpp
@@ -142,7 +142,8 @@ void GrLayerHoister::DrawLayers(const SkPicture* picture,
if (atlased.count() > 0) {
// All the atlased layers are rendered into the same GrTexture
SkAutoTUnref<SkSurface> surface(SkSurface::NewRenderTargetDirect(
- atlased[0]->texture()->asRenderTarget(), NULL));
+ atlased[0]->texture()->asRenderTarget(),
+ SkSurface::kStandard_TextRenderMode));
SkCanvas* atlasCanvas = surface->getCanvas();
@@ -195,7 +196,8 @@ void GrLayerHoister::DrawLayers(const SkPicture* picture,
// Each non-atlased layer has its own GrTexture
SkAutoTUnref<SkSurface> surface(SkSurface::NewRenderTargetDirect(
- layer->texture()->asRenderTarget(), NULL));
+ layer->texture()->asRenderTarget(),
+ SkSurface::kStandard_TextRenderMode));
SkCanvas* layerCanvas = surface->getCanvas();
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 7ce3446b72..02dca83ee0 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -133,15 +133,15 @@ public:
///////////////////////////////////////////////////////////////////////////////
-SkGpuDevice* SkGpuDevice::Create(GrSurface* surface, const SkSurfaceProps& props, unsigned flags) {
+SkGpuDevice* SkGpuDevice::Create(GrSurface* surface, unsigned flags) {
SkASSERT(surface);
if (NULL == surface->asRenderTarget() || surface->wasDestroyed()) {
return NULL;
}
- return SkNEW_ARGS(SkGpuDevice, (surface, props, flags));
+ return SkNEW_ARGS(SkGpuDevice, (surface, flags));
}
-SkGpuDevice::SkGpuDevice(GrSurface* surface, const SkSurfaceProps& props, unsigned flags) {
+SkGpuDevice::SkGpuDevice(GrSurface* surface, unsigned flags) {
fDrawProcs = NULL;
@@ -156,15 +156,13 @@ SkGpuDevice::SkGpuDevice(GrSurface* surface, const SkSurfaceProps& props, unsign
fLegacyBitmap.setInfo(surface->info());
fLegacyBitmap.setPixelRef(pr)->unref();
- this->setPixelGeometry(props.pixelGeometry());
-
bool useDFFonts = !!(flags & kDFFonts_Flag);
fMainTextContext = fContext->createTextContext(fRenderTarget, this->getLeakyProperties(), useDFFonts);
fFallbackTextContext = SkNEW_ARGS(GrBitmapTextContext, (fContext, this->getLeakyProperties()));
}
SkGpuDevice* SkGpuDevice::Create(GrContext* context, const SkImageInfo& origInfo,
- const SkSurfaceProps& props, int sampleCount) {
+ int sampleCount) {
if (kUnknown_SkColorType == origInfo.colorType() ||
origInfo.width() < 0 || origInfo.height() < 0) {
return NULL;
@@ -196,7 +194,7 @@ SkGpuDevice* SkGpuDevice::Create(GrContext* context, const SkImageInfo& origInfo
return NULL;
}
- return SkNEW_ARGS(SkGpuDevice, (texture.get(), props));
+ return SkNEW_ARGS(SkGpuDevice, (texture.get()));
}
SkGpuDevice::~SkGpuDevice() {
@@ -1807,7 +1805,7 @@ SkBaseDevice* SkGpuDevice::onCreateDevice(const SkImageInfo& info, Usage usage)
texture.reset(fContext->createUncachedTexture(desc, NULL, 0));
#endif
if (texture.get()) {
- return SkGpuDevice::Create(texture, SkSurfaceProps(SkSurfaceProps::kLegacyFontHost_InitType), flags);
+ return SkGpuDevice::Create(texture, flags);
} else {
GrPrintf("---- failed to create compatible device texture [%d %d]\n",
info.width(), info.height());
@@ -1815,8 +1813,8 @@ SkBaseDevice* SkGpuDevice::onCreateDevice(const SkImageInfo& info, Usage usage)
}
}
-SkSurface* SkGpuDevice::newSurface(const SkImageInfo& info, const SkSurfaceProps& props) {
- return SkSurface::NewRenderTarget(fContext, info, fRenderTarget->numSamples(), &props);
+SkSurface* SkGpuDevice::newSurface(const SkImageInfo& info) {
+ return SkSurface::NewRenderTarget(fContext, info, fRenderTarget->numSamples());
}
void SkGpuDevice::EXPERIMENTAL_optimize(const SkPicture* picture) {
diff --git a/src/gpu/SkGpuDevice.h b/src/gpu/SkGpuDevice.h
index 41b53b1213..dc59009dae 100644
--- a/src/gpu/SkGpuDevice.h
+++ b/src/gpu/SkGpuDevice.h
@@ -43,7 +43,7 @@ public:
* the kCached_Flag should be specified to make the device responsible for unlocking
* the surface when it is released.
*/
- static SkGpuDevice* Create(GrSurface* surface, const SkSurfaceProps&, unsigned flags = 0);
+ static SkGpuDevice* Create(GrSurface* surface, unsigned flags = 0);
/**
* New device that will create an offscreen renderTarget based on the
@@ -51,8 +51,7 @@ public:
* count against the GrContext's texture cache budget. The device's pixels
* will be uninitialized. On failure, returns NULL.
*/
- static SkGpuDevice* Create(GrContext*, const SkImageInfo&, const SkSurfaceProps&,
- int sampleCount);
+ static SkGpuDevice* Create(GrContext*, const SkImageInfo&, int sampleCount);
virtual ~SkGpuDevice();
@@ -146,11 +145,11 @@ private:
// remove when our clients don't rely on accessBitmap()
SkBitmap fLegacyBitmap;
- SkGpuDevice(GrSurface*, const SkSurfaceProps&, unsigned flags = 0);
+ SkGpuDevice(GrSurface*, unsigned flags = 0);
virtual SkBaseDevice* onCreateDevice(const SkImageInfo&, Usage) SK_OVERRIDE;
- virtual SkSurface* newSurface(const SkImageInfo&, const SkSurfaceProps&) SK_OVERRIDE;
+ virtual SkSurface* newSurface(const SkImageInfo&) SK_OVERRIDE;
virtual SkImageFilter::Cache* getImageFilterCache() SK_OVERRIDE;