Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(277)

Unified Diff: src/gpu/SkGpuDevice.cpp

Issue 1196683003: remove SkDeviceProperties (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Clean up Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/gpu/SkGpuDevice.cpp
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index c5069596248a629ce491fc535c5492765d6dac71..4eeb64262b12bb44e624ce183017e7ce3551c8a6 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -134,26 +134,9 @@ SkGpuDevice* SkGpuDevice::Create(GrRenderTarget* rt, int width, int height,
return SkNEW_ARGS(SkGpuDevice, (rt, width, height, props, flags));
}
-static SkDeviceProperties surfaceprops_to_deviceprops(const SkSurfaceProps* props) {
- if (props) {
- return SkDeviceProperties(props->pixelGeometry(), props->isUseDistanceFieldFonts());
- } else {
- return SkDeviceProperties();
- }
-}
-
-static SkSurfaceProps copy_or_default_props(const SkSurfaceProps* props) {
- if (props) {
- return SkSurfaceProps(*props);
- } else {
- return SkSurfaceProps(SkSurfaceProps::kLegacyFontHost_InitType);
- }
-}
-
SkGpuDevice::SkGpuDevice(GrRenderTarget* rt, int width, int height,
const SkSurfaceProps* props, unsigned flags)
- : INHERITED(surfaceprops_to_deviceprops(props))
- , fSurfaceProps(copy_or_default_props(props))
+ : INHERITED(SkSurfacePropsCopyOrDefault(props))
{
fDrawProcs = NULL;
@@ -1701,7 +1684,7 @@ SkBaseDevice* SkGpuDevice::onCreateDevice(const CreateInfo& cinfo, const SkPaint
texture.reset(fContext->textureProvider()->refScratchTexture(desc, match));
if (texture) {
- SkSurfaceProps props(fSurfaceProps.flags(), cinfo.fPixelGeometry);
+ SkSurfaceProps props(this->getLeakyProperties().flags(), cinfo.fPixelGeometry);
return SkGpuDevice::Create(
texture->asRenderTarget(), cinfo.fInfo.width(), cinfo.fInfo.height(), &props, flags);
} else {
« src/gpu/SkGpuDevice.h ('K') | « src/gpu/SkGpuDevice.h ('k') | src/image/SkSurface_Gpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698