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

Unified Diff: src/gpu/GrContext.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/GrContext.cpp
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index 7aaf6afe7e41531561c81695571a5e1662d9140e..ed588b6b51e2a89a902e7e8850a9736760b736b5 100755
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -43,6 +43,7 @@
#include "SkGr.h"
#include "SkRRect.h"
#include "SkStrokeRec.h"
+#include "SkSurfacePriv.h"
#include "SkTLazy.h"
#include "SkTLS.h"
#include "SkTraceEvent.h"
@@ -111,23 +112,20 @@ void GrContext::DrawingMgr::flush() {
}
}
-GrDrawContext* GrContext::DrawingMgr::drawContext(const SkDeviceProperties* devProps) {
+GrDrawContext* GrContext::DrawingMgr::drawContext(const SkSurfaceProps* surfaceProps) {
if (this->abandoned()) {
return NULL;
}
- const SkDeviceProperties defProps;
- if (!devProps) {
- devProps = &defProps;
- }
+ const SkSurfaceProps props(SkSurfacePropsCopyOrDefault(surfaceProps));
- SkASSERT(devProps->pixelGeometry() < kNumPixelGeometries);
- if (!fDrawContext[devProps->pixelGeometry()][devProps->useDFT()]) {
- fDrawContext[devProps->pixelGeometry()][devProps->useDFT()] =
- SkNEW_ARGS(GrDrawContext, (fContext, fDrawTarget, *devProps));
+ SkASSERT(props.pixelGeometry() < kNumPixelGeometries);
+ if (!fDrawContext[props.pixelGeometry()][props.isUseDistanceFieldFonts()]) {
+ fDrawContext[props.pixelGeometry()][props.isUseDistanceFieldFonts()] =
+ SkNEW_ARGS(GrDrawContext, (fContext, fDrawTarget, props));
}
- return fDrawContext[devProps->pixelGeometry()][devProps->useDFT()];
+ return fDrawContext[props.pixelGeometry()][props.isUseDistanceFieldFonts()];
}
////////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « src/gpu/GrAtlasTextContext.cpp ('k') | src/gpu/GrDrawContext.cpp » ('j') | src/gpu/SkGpuDevice.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698