| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "SkGpuDevice.h" | 8 #include "SkGpuDevice.h" |
| 9 | 9 |
| 10 #include "GrBlurUtils.h" | 10 #include "GrBlurUtils.h" |
| 11 #include "GrContext.h" | 11 #include "GrContext.h" |
| 12 #include "GrContextPriv.h" |
| 12 #include "SkDraw.h" | 13 #include "SkDraw.h" |
| 13 #include "GrGpu.h" | 14 #include "GrGpu.h" |
| 14 #include "GrGpuResourcePriv.h" | 15 #include "GrGpuResourcePriv.h" |
| 15 #include "GrImageIDTextureAdjuster.h" | 16 #include "GrImageIDTextureAdjuster.h" |
| 16 #include "GrStyle.h" | 17 #include "GrStyle.h" |
| 17 #include "GrTracing.h" | 18 #include "GrTracing.h" |
| 18 #include "SkCanvasPriv.h" | 19 #include "SkCanvasPriv.h" |
| 19 #include "SkErrorInternals.h" | 20 #include "SkErrorInternals.h" |
| 20 #include "SkGlyphCache.h" | 21 #include "SkGlyphCache.h" |
| 21 #include "SkGr.h" | 22 #include "SkGr.h" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 unsigned flags; | 98 unsigned flags; |
| 98 if (!CheckAlphaTypeAndGetFlags(nullptr, init, &flags)) { | 99 if (!CheckAlphaTypeAndGetFlags(nullptr, init, &flags)) { |
| 99 return nullptr; | 100 return nullptr; |
| 100 } | 101 } |
| 101 | 102 |
| 102 const int width = rt->width(); | 103 const int width = rt->width(); |
| 103 const int height = rt->height(); | 104 const int height = rt->height(); |
| 104 | 105 |
| 105 GrContext* context = rt->getContext(); | 106 GrContext* context = rt->getContext(); |
| 106 | 107 |
| 107 sk_sp<GrDrawContext> drawContext(context->makeDrawContext(std::move(rt), std
::move(colorSpace), | 108 sk_sp<GrDrawContext> drawContext(context->contextPriv().makeWrappedDrawConte
xt( |
| 108 props)); | 109 std:
:move(rt), |
| 110 std:
:move(colorSpace), |
| 111 prop
s)); |
| 109 return sk_sp<SkGpuDevice>(new SkGpuDevice(std::move(drawContext), width, hei
ght, flags)); | 112 return sk_sp<SkGpuDevice>(new SkGpuDevice(std::move(drawContext), width, hei
ght, flags)); |
| 110 } | 113 } |
| 111 | 114 |
| 112 sk_sp<SkBaseDevice> SkGpuDevice::Make(sk_sp<GrDrawContext> drawContext, | 115 sk_sp<SkBaseDevice> SkGpuDevice::Make(sk_sp<GrDrawContext> drawContext, |
| 113 int width, int height, | 116 int width, int height, |
| 114 InitContents init) { | 117 InitContents init) { |
| 115 if (!drawContext || drawContext->wasAbandoned()) { | 118 if (!drawContext || drawContext->wasAbandoned()) { |
| 116 return nullptr; | 119 return nullptr; |
| 117 } | 120 } |
| 118 unsigned flags; | 121 unsigned flags; |
| (...skipping 1657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1776 } | 1779 } |
| 1777 | 1780 |
| 1778 SkImageFilterCache* SkGpuDevice::getImageFilterCache() { | 1781 SkImageFilterCache* SkGpuDevice::getImageFilterCache() { |
| 1779 ASSERT_SINGLE_OWNER | 1782 ASSERT_SINGLE_OWNER |
| 1780 // We always return a transient cache, so it is freed after each | 1783 // We always return a transient cache, so it is freed after each |
| 1781 // filter traversal. | 1784 // filter traversal. |
| 1782 return SkImageFilterCache::Create(kDefaultImageFilterCacheSize); | 1785 return SkImageFilterCache::Create(kDefaultImageFilterCacheSize); |
| 1783 } | 1786 } |
| 1784 | 1787 |
| 1785 #endif | 1788 #endif |
| OLD | NEW |