| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 #include "GrContext.h" | 9 #include "GrContext.h" |
| 10 | 10 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 #define ASSERT_OWNED_RESOURCE(R) SkASSERT(!(R) || (R)->getContext() == this) | 53 #define ASSERT_OWNED_RESOURCE(R) SkASSERT(!(R) || (R)->getContext() == this) |
| 54 #define RETURN_IF_ABANDONED if (fDrawingMgr.abandoned()) { return; } | 54 #define RETURN_IF_ABANDONED if (fDrawingMgr.abandoned()) { return; } |
| 55 #define RETURN_FALSE_IF_ABANDONED if (fDrawingMgr.abandoned()) { return false; } | 55 #define RETURN_FALSE_IF_ABANDONED if (fDrawingMgr.abandoned()) { return false; } |
| 56 #define RETURN_NULL_IF_ABANDONED if (fDrawingMgr.abandoned()) { return nullptr;
} | 56 #define RETURN_NULL_IF_ABANDONED if (fDrawingMgr.abandoned()) { return nullptr;
} |
| 57 | 57 |
| 58 | 58 |
| 59 //////////////////////////////////////////////////////////////////////////////// | 59 //////////////////////////////////////////////////////////////////////////////// |
| 60 | 60 |
| 61 void GrContext::DrawingMgr::init(GrContext* context) { | 61 void GrContext::DrawingMgr::init(GrContext* context) { |
| 62 fContext = context; | 62 fContext = context; |
| 63 fDrawTarget = new GrClipTarget(context); | 63 fDrawTarget = new GrDrawTarget(context->getGpu(), context->resourceProvider(
)); |
| 64 } | 64 } |
| 65 | 65 |
| 66 void GrContext::DrawingMgr::cleanup() { | 66 void GrContext::DrawingMgr::cleanup() { |
| 67 SkSafeSetNull(fDrawTarget); | 67 SkSafeSetNull(fDrawTarget); |
| 68 for (int i = 0; i < kNumPixelGeometries; ++i) { | 68 for (int i = 0; i < kNumPixelGeometries; ++i) { |
| 69 SkSafeSetNull(fDrawContext[i][0]); | 69 SkSafeSetNull(fDrawContext[i][0]); |
| 70 SkSafeSetNull(fDrawContext[i][1]); | 70 SkSafeSetNull(fDrawContext[i][1]); |
| 71 } | 71 } |
| 72 } | 72 } |
| 73 | 73 |
| (...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 752 } | 752 } |
| 753 if (maxTextureBytes) { | 753 if (maxTextureBytes) { |
| 754 *maxTextureBytes = fResourceCache->getMaxResourceBytes(); | 754 *maxTextureBytes = fResourceCache->getMaxResourceBytes(); |
| 755 } | 755 } |
| 756 } | 756 } |
| 757 | 757 |
| 758 void GrContext::setResourceCacheLimits(int maxTextures, size_t maxTextureBytes)
{ | 758 void GrContext::setResourceCacheLimits(int maxTextures, size_t maxTextureBytes)
{ |
| 759 fResourceCache->setLimits(maxTextures, maxTextureBytes); | 759 fResourceCache->setLimits(maxTextures, maxTextureBytes); |
| 760 } | 760 } |
| 761 | 761 |
| OLD | NEW |