| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "SkTypes.h" | 8 #include "SkTypes.h" |
| 9 | 9 |
| 10 #include "SkDWriteGeometrySink.h" | 10 #include "SkDWriteGeometrySink.h" |
| 11 #include "SkFloatUtils.h" | 11 #include "SkFloatUtils.h" |
| 12 #include "SkPath.h" | 12 #include "SkPath.h" |
| 13 | 13 |
| 14 #include <dwrite.h> | 14 #include <dwrite.h> |
| 15 #include <d2d1.h> | 15 #include <d2d1.h> |
| 16 | 16 |
| 17 SkDWriteGeometrySink::SkDWriteGeometrySink(SkPath* path) : fRefCount(1), fPath(p
ath) { } | 17 SkDWriteGeometrySink::SkDWriteGeometrySink(SkPath* path) : fRefCount(1), fPath(p
ath) { } |
| 18 | 18 |
| 19 SkDWriteGeometrySink::~SkDWriteGeometrySink() { } | 19 SkDWriteGeometrySink::~SkDWriteGeometrySink() { } |
| 20 | 20 |
| 21 HRESULT STDMETHODCALLTYPE SkDWriteGeometrySink::QueryInterface(REFIID iid, void
**object) { | 21 HRESULT STDMETHODCALLTYPE SkDWriteGeometrySink::QueryInterface(REFIID iid, void
**object) { |
| 22 if (NULL == object) { | 22 if (nullptr == object) { |
| 23 return E_INVALIDARG; | 23 return E_INVALIDARG; |
| 24 } | 24 } |
| 25 if (iid == __uuidof(IUnknown) || iid == __uuidof(IDWriteGeometrySink)) { | 25 if (iid == __uuidof(IUnknown) || iid == __uuidof(IDWriteGeometrySink)) { |
| 26 *object = static_cast<IDWriteGeometrySink*>(this); | 26 *object = static_cast<IDWriteGeometrySink*>(this); |
| 27 this->AddRef(); | 27 this->AddRef(); |
| 28 return S_OK; | 28 return S_OK; |
| 29 } else { | 29 } else { |
| 30 *object = NULL; | 30 *object = nullptr; |
| 31 return E_NOINTERFACE; | 31 return E_NOINTERFACE; |
| 32 } | 32 } |
| 33 } | 33 } |
| 34 | 34 |
| 35 ULONG STDMETHODCALLTYPE SkDWriteGeometrySink::AddRef(void) { | 35 ULONG STDMETHODCALLTYPE SkDWriteGeometrySink::AddRef(void) { |
| 36 return static_cast<ULONG>(InterlockedIncrement(&fRefCount)); | 36 return static_cast<ULONG>(InterlockedIncrement(&fRefCount)); |
| 37 } | 37 } |
| 38 | 38 |
| 39 ULONG STDMETHODCALLTYPE SkDWriteGeometrySink::Release(void) { | 39 ULONG STDMETHODCALLTYPE SkDWriteGeometrySink::Release(void) { |
| 40 ULONG res = static_cast<ULONG>(InterlockedDecrement(&fRefCount)); | 40 ULONG res = static_cast<ULONG>(InterlockedDecrement(&fRefCount)); |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 } | 137 } |
| 138 | 138 |
| 139 HRESULT SkDWriteGeometrySink::Close() { | 139 HRESULT SkDWriteGeometrySink::Close() { |
| 140 return S_OK; | 140 return S_OK; |
| 141 } | 141 } |
| 142 | 142 |
| 143 HRESULT SkDWriteGeometrySink::Create(SkPath* path, IDWriteGeometrySink** geometr
yToPath) { | 143 HRESULT SkDWriteGeometrySink::Create(SkPath* path, IDWriteGeometrySink** geometr
yToPath) { |
| 144 *geometryToPath = new SkDWriteGeometrySink(path); | 144 *geometryToPath = new SkDWriteGeometrySink(path); |
| 145 return S_OK; | 145 return S_OK; |
| 146 } | 146 } |
| OLD | NEW |