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

Unified Diff: src/core/SkBitmapDevice.cpp

Issue 1204433002: Begin kLegacyFontHost_InitType cleanup (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add dox 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
« no previous file with comments | « include/utils/SkDeferredCanvas.h ('k') | src/core/SkCanvas.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkBitmapDevice.cpp
diff --git a/src/core/SkBitmapDevice.cpp b/src/core/SkBitmapDevice.cpp
index 34bd5b7cec6584358b1961f087133029ea681a48..b94daef41e635338888c1fd06dec7a394dcdde2b 100644
--- a/src/core/SkBitmapDevice.cpp
+++ b/src/core/SkBitmapDevice.cpp
@@ -58,19 +58,24 @@ static bool valid_for_bitmap_device(const SkImageInfo& info,
return true;
}
-SkBitmapDevice::SkBitmapDevice(const SkBitmap& bitmap) : fBitmap(bitmap) {
+SkBitmapDevice::SkBitmapDevice(const SkBitmap& bitmap)
+ : INHERITED(SkSurfaceProps(SkSurfaceProps::kLegacyFontHost_InitType))
+ , fBitmap(bitmap) {
SkASSERT(valid_for_bitmap_device(bitmap.info(), NULL));
}
+SkBitmapDevice* SkBitmapDevice::Create(const SkImageInfo& info) {
+ return Create(info, SkSurfaceProps(SkSurfaceProps::kLegacyFontHost_InitType));
+}
+
SkBitmapDevice::SkBitmapDevice(const SkBitmap& bitmap, const SkSurfaceProps& surfaceProps)
- : SkBaseDevice(surfaceProps)
- , fBitmap(bitmap)
-{
+ : INHERITED(surfaceProps)
+ , fBitmap(bitmap) {
SkASSERT(valid_for_bitmap_device(bitmap.info(), NULL));
}
SkBitmapDevice* SkBitmapDevice::Create(const SkImageInfo& origInfo,
- const SkSurfaceProps* surfaceProps) {
+ const SkSurfaceProps& surfaceProps) {
SkAlphaType newAT = origInfo.alphaType();
if (!valid_for_bitmap_device(origInfo, &newAT)) {
return NULL;
@@ -92,11 +97,7 @@ SkBitmapDevice* SkBitmapDevice::Create(const SkImageInfo& origInfo,
}
}
- if (surfaceProps) {
- return SkNEW_ARGS(SkBitmapDevice, (bitmap, *surfaceProps));
- } else {
- return SkNEW_ARGS(SkBitmapDevice, (bitmap));
- }
+ return SkNEW_ARGS(SkBitmapDevice, (bitmap, surfaceProps));
}
SkImageInfo SkBitmapDevice::imageInfo() const {
@@ -116,8 +117,8 @@ void SkBitmapDevice::replaceBitmapBackendForRasterSurface(const SkBitmap& bm) {
}
SkBaseDevice* SkBitmapDevice::onCreateDevice(const CreateInfo& cinfo, const SkPaint*) {
- const SkSurfaceProps surfaceProps(0, cinfo.fPixelGeometry);
- return SkBitmapDevice::Create(cinfo.fInfo, &surfaceProps);
+ const SkSurfaceProps surfaceProps(this->surfaceProps().flags(), cinfo.fPixelGeometry);
+ return SkBitmapDevice::Create(cinfo.fInfo, surfaceProps);
}
const SkBitmap& SkBitmapDevice::onAccessBitmap() {
« no previous file with comments | « include/utils/SkDeferredCanvas.h ('k') | src/core/SkCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698