diff options
author | bungeman <bungeman@google.com> | 2016-06-16 10:42:23 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-06-16 10:42:23 -0700 |
commit | bd770d619553a88eeaa64ff29082f62db5c9b4d2 (patch) | |
tree | fb3b884831a17b06324087e34b276660fc34ae45 /include | |
parent | c7027ab03f2e8bab4c74bc1b047642622d3d682b (diff) |
Support pixel antialising in DirectWrite.
DirectWrite2 supports pixel antialiasing and rendering without hinting.
BUG=skia:5416
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2065833002
TBR=reed
Will move SkTScopedComPtr into src.
Review-Url: https://codereview.chromium.org/2065833002
Diffstat (limited to 'include')
-rw-r--r-- | include/utils/win/SkTScopedComPtr.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/include/utils/win/SkTScopedComPtr.h b/include/utils/win/SkTScopedComPtr.h index 6fb6143adc..58bf8733a4 100644 --- a/include/utils/win/SkTScopedComPtr.h +++ b/include/utils/win/SkTScopedComPtr.h @@ -37,11 +37,11 @@ private: T *fPtr; public: - explicit SkTScopedComPtr(T *ptr = NULL) : fPtr(ptr) { } + explicit SkTScopedComPtr(T *ptr = nullptr) : fPtr(ptr) { } ~SkTScopedComPtr() { this->reset(); } - T &operator*() const { SkASSERT(fPtr != NULL); return *fPtr; } + T &operator*() const { SkASSERT(fPtr != nullptr); return *fPtr; } SkBlockComRef<T> *operator->() const { return static_cast<SkBlockComRef<T>*>(fPtr); } @@ -51,12 +51,13 @@ public: * Must only be used on instances currently pointing to NULL, * and only to initialize the instance. */ - T **operator&() { SkASSERT(fPtr == NULL); return &fPtr; } + T **operator&() { SkASSERT(fPtr == nullptr); return &fPtr; } + explicit operator bool() const { return fPtr != nullptr; } T *get() const { return fPtr; } void reset() { if (this->fPtr) { this->fPtr->Release(); - this->fPtr = NULL; + this->fPtr = nullptr; } } @@ -68,7 +69,7 @@ public: T* release() { T* temp = this->fPtr; - this->fPtr = NULL; + this->fPtr = nullptr; return temp; } }; |