Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(667)

Side by Side Diff: src/gpu/GrBitmapTextContext.cpp

Issue 446953002: Add an opaqueness hint to GrDrawState. (Closed) Base URL: https://skia.googlesource.com/skia.git@greg
Patch Set: Address comments Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/gpu/GrContext.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "GrBitmapTextContext.h" 8 #include "GrBitmapTextContext.h"
9 #include "GrAtlas.h" 9 #include "GrAtlas.h"
10 #include "GrDrawTarget.h" 10 #include "GrDrawTarget.h"
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 585
586 // The texture coords are last in both the with and without color vertex lay outs. 586 // The texture coords are last in both the with and without color vertex lay outs.
587 SkPoint* textureCoords = reinterpret_cast<SkPoint*>( 587 SkPoint* textureCoords = reinterpret_cast<SkPoint*>(
588 reinterpret_cast<intptr_t>(positions) + vertSize - sizeof(SkPoint)) ; 588 reinterpret_cast<intptr_t>(positions) + vertSize - sizeof(SkPoint)) ;
589 textureCoords->setRectFan(SkFixedToFloat(texture->normalizeFixedX(tx)), 589 textureCoords->setRectFan(SkFixedToFloat(texture->normalizeFixedX(tx)),
590 SkFixedToFloat(texture->normalizeFixedY(ty)), 590 SkFixedToFloat(texture->normalizeFixedY(ty)),
591 SkFixedToFloat(texture->normalizeFixedX(tx + width )), 591 SkFixedToFloat(texture->normalizeFixedX(tx + width )),
592 SkFixedToFloat(texture->normalizeFixedY(ty + heigh t)), 592 SkFixedToFloat(texture->normalizeFixedY(ty + heigh t)),
593 vertSize); 593 vertSize);
594 if (useColorVerts) { 594 if (useColorVerts) {
595 if (0xFF == GrColorUnpackA(fPaint.getColor())) {
596 fDrawTarget->drawState()->setHint(GrDrawState::kVertexColorsAreOpaqu e_Hint, true);
597 }
595 // color comes after position. 598 // color comes after position.
596 GrColor* colors = reinterpret_cast<GrColor*>(positions + 1); 599 GrColor* colors = reinterpret_cast<GrColor*>(positions + 1);
597 for (int i = 0; i < 4; ++i) { 600 for (int i = 0; i < 4; ++i) {
598 *colors = fPaint.getColor(); 601 *colors = fPaint.getColor();
599 colors = reinterpret_cast<GrColor*>(reinterpret_cast<intptr_t>(colors ) + vertSize); 602 colors = reinterpret_cast<GrColor*>(reinterpret_cast<intptr_t>(colors ) + vertSize);
600 } 603 }
601 } 604 }
602 fCurrVertex += 4; 605 fCurrVertex += 4;
603 } 606 }
OLDNEW
« no previous file with comments | « no previous file | src/gpu/GrContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698