| 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 "GrPipeline.h" | 8 #include "GrPipeline.h" |
| 9 | 9 |
| 10 #include "GrCaps.h" | 10 #include "GrCaps.h" |
| 11 #include "GrRenderTargetContext.h" | 11 #include "GrRenderTargetContext.h" |
| 12 #include "GrGpu.h" | 12 #include "GrGpu.h" |
| 13 #include "GrPipelineBuilder.h" | 13 #include "GrPipelineBuilder.h" |
| 14 #include "GrProcOptInfo.h" | 14 #include "GrProcOptInfo.h" |
| 15 #include "GrRenderTargetContextPriv.h" |
| 15 #include "GrRenderTargetOpList.h" | 16 #include "GrRenderTargetOpList.h" |
| 16 #include "GrRenderTargetPriv.h" | 17 #include "GrRenderTargetPriv.h" |
| 17 #include "GrXferProcessor.h" | 18 #include "GrXferProcessor.h" |
| 18 | 19 |
| 19 #include "batches/GrBatch.h" | 20 #include "batches/GrBatch.h" |
| 20 | 21 |
| 21 GrPipeline* GrPipeline::CreateAt(void* memory, const CreateArgs& args, | 22 GrPipeline* GrPipeline::CreateAt(void* memory, const CreateArgs& args, |
| 22 GrXPOverridesForBatch* overrides) { | 23 GrXPOverridesForBatch* overrides) { |
| 23 const GrPipelineBuilder& builder = *args.fPipelineBuilder; | 24 const GrPipelineBuilder& builder = *args.fPipelineBuilder; |
| 24 const GrUserStencilSettings* userStencil = builder.getUserStencil(); | 25 const GrUserStencilSettings* userStencil = builder.getUserStencil(); |
| 25 GrRenderTarget* rt = args.fRenderTargetContext->accessRenderTarget(); | |
| 26 | 26 |
| 27 GrPipeline* pipeline = new (memory) GrPipeline; | 27 GrPipeline* pipeline = new (memory) GrPipeline; |
| 28 GrRenderTarget* rt = args.fRenderTargetContext->instantiate(); |
| 28 pipeline->fRenderTarget.reset(rt); | 29 pipeline->fRenderTarget.reset(rt); |
| 29 SkASSERT(pipeline->fRenderTarget); | 30 SkASSERT(pipeline->fRenderTarget); |
| 30 pipeline->fScissorState = *args.fScissor; | 31 pipeline->fScissorState = *args.fScissor; |
| 31 pipeline->fWindowRectsState = *args.fWindowRectsState; | 32 pipeline->fWindowRectsState = *args.fWindowRectsState; |
| 32 pipeline->fUserStencilSettings = userStencil; | 33 pipeline->fUserStencilSettings = userStencil; |
| 33 pipeline->fDrawFace = builder.getDrawFace(); | 34 pipeline->fDrawFace = builder.getDrawFace(); |
| 34 | 35 |
| 35 pipeline->fFlags = 0; | 36 pipeline->fFlags = 0; |
| 36 if (builder.isHWAntialias()) { | 37 if (builder.isHWAntialias()) { |
| 37 pipeline->fFlags |= kHWAA_Flag; | 38 pipeline->fFlags |= kHWAA_Flag; |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 } | 239 } |
| 239 } | 240 } |
| 240 | 241 |
| 241 for (int i = 0; i < a.numFragmentProcessors(); i++) { | 242 for (int i = 0; i < a.numFragmentProcessors(); i++) { |
| 242 if (!a.getFragmentProcessor(i).isEqual(b.getFragmentProcessor(i))) { | 243 if (!a.getFragmentProcessor(i).isEqual(b.getFragmentProcessor(i))) { |
| 243 return false; | 244 return false; |
| 244 } | 245 } |
| 245 } | 246 } |
| 246 return true; | 247 return true; |
| 247 } | 248 } |
| OLD | NEW |