| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "GrResourceProvider.h" | 8 #include "GrResourceProvider.h" |
| 9 | 9 |
| 10 #include "GrBuffer.h" | 10 #include "GrBuffer.h" |
| 11 #include "GrGpu.h" | 11 #include "GrGpu.h" |
| 12 #include "GrPathRendering.h" | 12 #include "GrPathRendering.h" |
| 13 #include "GrRenderTarget.h" | 13 #include "GrRenderTarget.h" |
| 14 #include "GrRenderTargetPriv.h" | 14 #include "GrRenderTargetPriv.h" |
| 15 #include "GrResourceCache.h" | 15 #include "GrResourceCache.h" |
| 16 #include "GrResourceKey.h" | 16 #include "GrResourceKey.h" |
| 17 #include "GrStencilAttachment.h" | 17 #include "GrStencilAttachment.h" |
| 18 #include "SkMathPriv.h" |
| 18 | 19 |
| 19 GR_DECLARE_STATIC_UNIQUE_KEY(gQuadIndexBufferKey); | 20 GR_DECLARE_STATIC_UNIQUE_KEY(gQuadIndexBufferKey); |
| 20 | 21 |
| 21 GrResourceProvider::GrResourceProvider(GrGpu* gpu, GrResourceCache* cache, GrSin
gleOwner* owner) | 22 GrResourceProvider::GrResourceProvider(GrGpu* gpu, GrResourceCache* cache, GrSin
gleOwner* owner) |
| 22 : INHERITED(gpu, cache, owner) { | 23 : INHERITED(gpu, cache, owner) { |
| 23 GR_DEFINE_STATIC_UNIQUE_KEY(gQuadIndexBufferKey); | 24 GR_DEFINE_STATIC_UNIQUE_KEY(gQuadIndexBufferKey); |
| 24 fQuadIndexBufferKey = gQuadIndexBufferKey; | 25 fQuadIndexBufferKey = gQuadIndexBufferKey; |
| 25 } | 26 } |
| 26 | 27 |
| 27 const GrBuffer* GrResourceProvider::createInstancedIndexBuffer(const uint16_t* p
attern, | 28 const GrBuffer* GrResourceProvider::createInstancedIndexBuffer(const uint16_t* p
attern, |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 return rt->renderTargetPriv().getStencilAttachment(); | 197 return rt->renderTargetPriv().getStencilAttachment(); |
| 197 } | 198 } |
| 198 | 199 |
| 199 GrRenderTarget* GrResourceProvider::wrapBackendTextureAsRenderTarget( | 200 GrRenderTarget* GrResourceProvider::wrapBackendTextureAsRenderTarget( |
| 200 const GrBackendTextureDesc& desc) { | 201 const GrBackendTextureDesc& desc) { |
| 201 if (this->isAbandoned()) { | 202 if (this->isAbandoned()) { |
| 202 return nullptr; | 203 return nullptr; |
| 203 } | 204 } |
| 204 return this->gpu()->wrapBackendTextureAsRenderTarget(desc); | 205 return this->gpu()->wrapBackendTextureAsRenderTarget(desc); |
| 205 } | 206 } |
| OLD | NEW |