| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "GrOvalRenderer.h" | 8 #include "GrOvalRenderer.h" |
| 9 | 9 |
| 10 #include "GrProcessor.h" | 10 #include "GrProcessor.h" |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 const GrGLCaps& caps, | 159 const GrGLCaps& caps, |
| 160 GrProcessorKeyBuilder* b) const SK_OVERRIDE { | 160 GrProcessorKeyBuilder* b) const SK_OVERRIDE { |
| 161 GLProcessor::GenKey(*this, bt, caps, b); | 161 GLProcessor::GenKey(*this, bt, caps, b); |
| 162 } | 162 } |
| 163 | 163 |
| 164 virtual GrGLPrimitiveProcessor* createGLInstance(const GrBatchTracker& bt, | 164 virtual GrGLPrimitiveProcessor* createGLInstance(const GrBatchTracker& bt, |
| 165 const GrGLCaps&) const SK_O
VERRIDE { | 165 const GrGLCaps&) const SK_O
VERRIDE { |
| 166 return SkNEW_ARGS(GLProcessor, (*this, bt)); | 166 return SkNEW_ARGS(GLProcessor, (*this, bt)); |
| 167 } | 167 } |
| 168 | 168 |
| 169 void initBatchTracker(GrBatchTracker* bt, const InitBT& init) const SK_OVERR
IDE { | 169 void initBatchTracker(GrBatchTracker* bt, const GrPipelineInfo& init) const
SK_OVERRIDE { |
| 170 BatchTracker* local = bt->cast<BatchTracker>(); | 170 BatchTracker* local = bt->cast<BatchTracker>(); |
| 171 local->fInputColorType = GetColorInputType(&local->fColor, this->color()
, init, false); | 171 local->fInputColorType = GetColorInputType(&local->fColor, this->color()
, init, false); |
| 172 local->fUsesLocalCoords = init.fUsesLocalCoords; | 172 local->fUsesLocalCoords = init.fUsesLocalCoords; |
| 173 } | 173 } |
| 174 | 174 |
| 175 bool onCanMakeEqual(const GrBatchTracker& m, | 175 bool onCanMakeEqual(const GrBatchTracker& m, |
| 176 const GrGeometryProcessor& that, | 176 const GrGeometryProcessor& that, |
| 177 const GrBatchTracker& t) const SK_OVERRIDE { | 177 const GrBatchTracker& t) const SK_OVERRIDE { |
| 178 const BatchTracker& mine = m.cast<BatchTracker>(); | 178 const BatchTracker& mine = m.cast<BatchTracker>(); |
| 179 const BatchTracker& theirs = t.cast<BatchTracker>(); | 179 const BatchTracker& theirs = t.cast<BatchTracker>(); |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 const GrGLCaps& caps, | 358 const GrGLCaps& caps, |
| 359 GrProcessorKeyBuilder* b) const SK_OVERRIDE { | 359 GrProcessorKeyBuilder* b) const SK_OVERRIDE { |
| 360 GLProcessor::GenKey(*this, bt, caps, b); | 360 GLProcessor::GenKey(*this, bt, caps, b); |
| 361 } | 361 } |
| 362 | 362 |
| 363 virtual GrGLPrimitiveProcessor* createGLInstance(const GrBatchTracker& bt, | 363 virtual GrGLPrimitiveProcessor* createGLInstance(const GrBatchTracker& bt, |
| 364 const GrGLCaps&) const SK_O
VERRIDE { | 364 const GrGLCaps&) const SK_O
VERRIDE { |
| 365 return SkNEW_ARGS(GLProcessor, (*this, bt)); | 365 return SkNEW_ARGS(GLProcessor, (*this, bt)); |
| 366 } | 366 } |
| 367 | 367 |
| 368 void initBatchTracker(GrBatchTracker* bt, const InitBT& init) const SK_OVERR
IDE { | 368 void initBatchTracker(GrBatchTracker* bt, const GrPipelineInfo& init) const
SK_OVERRIDE { |
| 369 BatchTracker* local = bt->cast<BatchTracker>(); | 369 BatchTracker* local = bt->cast<BatchTracker>(); |
| 370 local->fInputColorType = GetColorInputType(&local->fColor, this->color()
, init, false); | 370 local->fInputColorType = GetColorInputType(&local->fColor, this->color()
, init, false); |
| 371 local->fUsesLocalCoords = init.fUsesLocalCoords; | 371 local->fUsesLocalCoords = init.fUsesLocalCoords; |
| 372 } | 372 } |
| 373 | 373 |
| 374 bool onCanMakeEqual(const GrBatchTracker& m, | 374 bool onCanMakeEqual(const GrBatchTracker& m, |
| 375 const GrGeometryProcessor& that, | 375 const GrGeometryProcessor& that, |
| 376 const GrBatchTracker& t) const SK_OVERRIDE { | 376 const GrBatchTracker& t) const SK_OVERRIDE { |
| 377 const BatchTracker& mine = m.cast<BatchTracker>(); | 377 const BatchTracker& mine = m.cast<BatchTracker>(); |
| 378 const BatchTracker& theirs = t.cast<BatchTracker>(); | 378 const BatchTracker& theirs = t.cast<BatchTracker>(); |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 577 const GrGLCaps& caps, | 577 const GrGLCaps& caps, |
| 578 GrProcessorKeyBuilder* b) const SK_OVERRIDE { | 578 GrProcessorKeyBuilder* b) const SK_OVERRIDE { |
| 579 GLProcessor::GenKey(*this, bt, caps, b); | 579 GLProcessor::GenKey(*this, bt, caps, b); |
| 580 } | 580 } |
| 581 | 581 |
| 582 virtual GrGLPrimitiveProcessor* createGLInstance(const GrBatchTracker& bt, | 582 virtual GrGLPrimitiveProcessor* createGLInstance(const GrBatchTracker& bt, |
| 583 const GrGLCaps&) const SK_O
VERRIDE { | 583 const GrGLCaps&) const SK_O
VERRIDE { |
| 584 return SkNEW_ARGS(GLProcessor, (*this, bt)); | 584 return SkNEW_ARGS(GLProcessor, (*this, bt)); |
| 585 } | 585 } |
| 586 | 586 |
| 587 void initBatchTracker(GrBatchTracker* bt, const InitBT& init) const SK_OVERR
IDE { | 587 void initBatchTracker(GrBatchTracker* bt, const GrPipelineInfo& init) const
SK_OVERRIDE { |
| 588 BatchTracker* local = bt->cast<BatchTracker>(); | 588 BatchTracker* local = bt->cast<BatchTracker>(); |
| 589 local->fInputColorType = GetColorInputType(&local->fColor, this->color()
, init, false); | 589 local->fInputColorType = GetColorInputType(&local->fColor, this->color()
, init, false); |
| 590 local->fUsesLocalCoords = init.fUsesLocalCoords; | 590 local->fUsesLocalCoords = init.fUsesLocalCoords; |
| 591 } | 591 } |
| 592 | 592 |
| 593 bool onCanMakeEqual(const GrBatchTracker& m, | 593 bool onCanMakeEqual(const GrBatchTracker& m, |
| 594 const GrGeometryProcessor& that, | 594 const GrGeometryProcessor& that, |
| 595 const GrBatchTracker& t) const SK_OVERRIDE { | 595 const GrBatchTracker& t) const SK_OVERRIDE { |
| 596 const BatchTracker& mine = m.cast<BatchTracker>(); | 596 const BatchTracker& mine = m.cast<BatchTracker>(); |
| 597 const BatchTracker& theirs = t.cast<BatchTracker>(); | 597 const BatchTracker& theirs = t.cast<BatchTracker>(); |
| (...skipping 815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1413 int indexCnt = isStrokeOnly ? SK_ARRAY_COUNT(gRRectIndices) - 6 : | 1413 int indexCnt = isStrokeOnly ? SK_ARRAY_COUNT(gRRectIndices) - 6 : |
| 1414 SK_ARRAY_COUNT(gRRectIndices); | 1414 SK_ARRAY_COUNT(gRRectIndices); |
| 1415 target->setIndexSourceToBuffer(indexBuffer); | 1415 target->setIndexSourceToBuffer(indexBuffer); |
| 1416 target->drawIndexedInstances(pipelineBuilder, effect, kTriangles_GrPrimi
tiveType, 1, 16, | 1416 target->drawIndexedInstances(pipelineBuilder, effect, kTriangles_GrPrimi
tiveType, 1, 16, |
| 1417 indexCnt, &bounds); | 1417 indexCnt, &bounds); |
| 1418 } | 1418 } |
| 1419 | 1419 |
| 1420 target->resetIndexSource(); | 1420 target->resetIndexSource(); |
| 1421 return true; | 1421 return true; |
| 1422 } | 1422 } |
| OLD | NEW |