OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "GrInOrderDrawBuffer.h" | 8 #include "GrInOrderDrawBuffer.h" |
9 | 9 |
10 #include "GrDefaultGeoProcFactory.h" | 10 #include "GrDefaultGeoProcFactory.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 | 39 |
40 The vertex attrib order is always pos, color, [local coords]. | 40 The vertex attrib order is always pos, color, [local coords]. |
41 */ | 41 */ |
42 static const GrGeometryProcessor* create_rect_gp(bool hasExplicitLocalCoords, | 42 static const GrGeometryProcessor* create_rect_gp(bool hasExplicitLocalCoords, |
43 GrColor color, | 43 GrColor color, |
44 const SkMatrix* localMatrix) { | 44 const SkMatrix* localMatrix) { |
45 uint32_t flags = GrDefaultGeoProcFactory::kPosition_GPType | | 45 uint32_t flags = GrDefaultGeoProcFactory::kPosition_GPType | |
46 GrDefaultGeoProcFactory::kColor_GPType; | 46 GrDefaultGeoProcFactory::kColor_GPType; |
47 flags |= hasExplicitLocalCoords ? GrDefaultGeoProcFactory::kLocalCoord_GPTyp
e : 0; | 47 flags |= hasExplicitLocalCoords ? GrDefaultGeoProcFactory::kLocalCoord_GPTyp
e : 0; |
48 if (localMatrix) { | 48 if (localMatrix) { |
49 return GrDefaultGeoProcFactory::Create(flags, color, SkMatrix::I(), *loc
alMatrix); | 49 return GrDefaultGeoProcFactory::Create(flags, color, SkMatrix::I(), *loc
alMatrix, |
| 50 GrColorIsOpaque(color)); |
50 } else { | 51 } else { |
51 return GrDefaultGeoProcFactory::Create(flags, color, SkMatrix::I(), SkMa
trix::I()); | 52 return GrDefaultGeoProcFactory::Create(flags, color, SkMatrix::I(), SkMa
trix::I(), |
| 53 GrColorIsOpaque(color)); |
52 } | 54 } |
53 } | 55 } |
54 | 56 |
55 class RectBatch : public GrBatch { | 57 class RectBatch : public GrBatch { |
56 public: | 58 public: |
57 struct Geometry { | 59 struct Geometry { |
58 GrColor fColor; | 60 GrColor fColor; |
59 SkMatrix fViewMatrix; | 61 SkMatrix fViewMatrix; |
60 SkRect fRect; | 62 SkRect fRect; |
61 bool fHasLocalRect; | 63 bool fHasLocalRect; |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 | 410 |
409 void GrInOrderDrawBuffer::willReserveVertexAndIndexSpace(int vertexCount, | 411 void GrInOrderDrawBuffer::willReserveVertexAndIndexSpace(int vertexCount, |
410 size_t vertexStride, | 412 size_t vertexStride, |
411 int indexCount) { | 413 int indexCount) { |
412 #ifndef USE_BITMAP_TEXTBLOBS | 414 #ifndef USE_BITMAP_TEXTBLOBS |
413 fCommands.closeBatch(); | 415 fCommands.closeBatch(); |
414 #endif | 416 #endif |
415 | 417 |
416 this->INHERITED::willReserveVertexAndIndexSpace(vertexCount, vertexStride, i
ndexCount); | 418 this->INHERITED::willReserveVertexAndIndexSpace(vertexCount, vertexStride, i
ndexCount); |
417 } | 419 } |
OLD | NEW |