| 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 #ifndef GrDrawingManager_DEFINED | 8 #ifndef GrDrawingManager_DEFINED |
| 9 #define GrDrawingManager_DEFINED | 9 #define GrDrawingManager_DEFINED |
| 10 | 10 |
| 11 #include "GrDrawTarget.h" | 11 #include "GrDrawTarget.h" |
| 12 #include "GrBatchFlushState.h" |
| 12 #include "GrPathRendererChain.h" | 13 #include "GrPathRendererChain.h" |
| 13 #include "GrPathRenderer.h" | 14 #include "GrPathRenderer.h" |
| 14 #include "SkTDArray.h" | 15 #include "SkTDArray.h" |
| 15 | 16 |
| 16 class GrContext; | 17 class GrContext; |
| 17 class GrDrawContext; | 18 class GrDrawContext; |
| 18 class GrSoftwarePathRenderer; | 19 class GrSoftwarePathRenderer; |
| 19 class GrTextContext; | 20 class GrTextContext; |
| 20 | 21 |
| 21 // Currently the DrawingManager creates a separate GrTextContext for each | 22 // Currently the DrawingManager creates a separate GrTextContext for each |
| (...skipping 20 matching lines...) Expand all Loading... |
| 42 // be balanced by an unref call. | 43 // be balanced by an unref call. |
| 43 GrDrawTarget* newDrawTarget(GrRenderTarget* rt); | 44 GrDrawTarget* newDrawTarget(GrRenderTarget* rt); |
| 44 | 45 |
| 45 GrContext* getContext() { return fContext; } | 46 GrContext* getContext() { return fContext; } |
| 46 | 47 |
| 47 GrPathRenderer* getPathRenderer(const GrPathRenderer::CanDrawPathArgs& args, | 48 GrPathRenderer* getPathRenderer(const GrPathRenderer::CanDrawPathArgs& args, |
| 48 bool allowSW, | 49 bool allowSW, |
| 49 GrPathRendererChain::DrawType drawType, | 50 GrPathRendererChain::DrawType drawType, |
| 50 GrPathRenderer::StencilSupport* stencilSuppo
rt = NULL); | 51 GrPathRenderer::StencilSupport* stencilSuppo
rt = NULL); |
| 51 | 52 |
| 53 static bool ProgramUnitTest(GrContext* context, GrDrawTarget* drawTarget, in
t maxStages); |
| 54 |
| 52 private: | 55 private: |
| 53 GrDrawingManager(GrContext* context, GrDrawTarget::Options options) | 56 GrDrawingManager(GrContext* context) |
| 54 : fContext(context) | 57 : fContext(context) |
| 55 , fAbandoned(false) | 58 , fAbandoned(false) |
| 56 , fOptions(options) | |
| 57 , fNVPRTextContext(nullptr) | 59 , fNVPRTextContext(nullptr) |
| 58 , fPathRendererChain(nullptr) | 60 , fPathRendererChain(nullptr) |
| 59 , fSoftwarePathRenderer(nullptr) { | 61 , fSoftwarePathRenderer(nullptr) |
| 62 , fFlushState(context->getGpu(), context->resourceProvider()) { |
| 60 sk_bzero(fTextContexts, sizeof(fTextContexts)); | 63 sk_bzero(fTextContexts, sizeof(fTextContexts)); |
| 61 } | 64 } |
| 62 | 65 |
| 63 void abandon(); | 66 void abandon(); |
| 64 void cleanup(); | 67 void cleanup(); |
| 65 void reset(); | 68 void reset(); |
| 66 void flush(); | 69 void flush(); |
| 67 | 70 |
| 68 friend class GrContext; // for access to: ctor, abandon, reset & flush | 71 friend class GrContext; // for access to: ctor, abandon, reset & flush |
| 69 | 72 |
| 70 static const int kNumPixelGeometries = 5; // The different pixel geometries | 73 static const int kNumPixelGeometries = 5; // The different pixel geometries |
| 71 static const int kNumDFTOptions = 2; // DFT or no DFT | 74 static const int kNumDFTOptions = 2; // DFT or no DFT |
| 72 | 75 |
| 73 GrContext* fContext; | 76 GrContext* fContext; |
| 74 | 77 |
| 75 bool fAbandoned; | 78 bool fAbandoned; |
| 76 SkTDArray<GrDrawTarget*> fDrawTargets; | 79 SkTDArray<GrDrawTarget*> fDrawTargets; |
| 77 GrDrawTarget::Options fOptions; | |
| 78 | 80 |
| 79 GrTextContext* fNVPRTextContext; | 81 GrTextContext* fNVPRTextContext; |
| 80 GrTextContext* fTextContexts[kNumPixelGeometries][kNumDFTOption
s]; | 82 GrTextContext* fTextContexts[kNumPixelGeometries][kNumDFTOption
s]; |
| 81 | 83 |
| 82 GrPathRendererChain* fPathRendererChain; | 84 GrPathRendererChain* fPathRendererChain; |
| 83 GrSoftwarePathRenderer* fSoftwarePathRenderer; | 85 GrSoftwarePathRenderer* fSoftwarePathRenderer; |
| 86 |
| 87 GrBatchFlushState fFlushState; |
| 84 }; | 88 }; |
| 85 | 89 |
| 86 #endif | 90 #endif |
| OLD | NEW |