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

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

Issue 16928010: Make text context responsible for setting GrPaint on GrDrawState. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 6 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 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 "GrDrawState.h" 8 #include "GrDrawState.h"
9 #include "GrPaint.h" 9 #include "GrPaint.h"
10 10
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 57
58 fCommon.fViewMatrix = vm; 58 fCommon.fViewMatrix = vm;
59 59
60 // These have no equivalent in GrPaint, set them to defaults 60 // These have no equivalent in GrPaint, set them to defaults
61 fCommon.fBlendConstant = 0x0; 61 fCommon.fBlendConstant = 0x0;
62 fCommon.fCoverage = 0xffffffff; 62 fCommon.fCoverage = 0xffffffff;
63 fCommon.fDrawFace = kBoth_DrawFace; 63 fCommon.fDrawFace = kBoth_DrawFace;
64 fCommon.fStencilSettings.setDisabled(); 64 fCommon.fStencilSettings.setDisabled();
65 this->resetStateFlags(); 65 this->resetStateFlags();
66 66
67 // Enable the clip bit
68 this->enableState(GrDrawState::kClip_StateBit);
69
67 this->setColor(paint.getColor()); 70 this->setColor(paint.getColor());
68 this->setState(GrDrawState::kDither_StateBit, paint.isDither()); 71 this->setState(GrDrawState::kDither_StateBit, paint.isDither());
69 this->setState(GrDrawState::kHWAntialias_StateBit, paint.isAntiAlias()); 72 this->setState(GrDrawState::kHWAntialias_StateBit, paint.isAntiAlias());
70 73
71 this->setBlendFunc(paint.getSrcBlendCoeff(), paint.getDstBlendCoeff()); 74 this->setBlendFunc(paint.getSrcBlendCoeff(), paint.getDstBlendCoeff());
72 this->setColorFilter(paint.getColorFilterColor(), paint.getColorFilterMode() ); 75 this->setColorFilter(paint.getColorFilterColor(), paint.getColorFilterMode() );
73 this->setCoverage(paint.getCoverage()); 76 this->setCoverage(paint.getCoverage());
74 } 77 }
75 78
76 //////////////////////////////////////////////////////////////////////////////// 79 ////////////////////////////////////////////////////////////////////////////////
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 fRestoreMask |= (1 << s); 466 fRestoreMask |= (1 << s);
464 drawState->fStages[s].saveCoordChange(&fSavedCoordChanges[s]); 467 drawState->fStages[s].saveCoordChange(&fSavedCoordChanges[s]);
465 } 468 }
466 } 469 }
467 if (!drawState->setIdentityViewMatrix()) { 470 if (!drawState->setIdentityViewMatrix()) {
468 return false; 471 return false;
469 } 472 }
470 fDrawState = drawState; 473 fDrawState = drawState;
471 return true; 474 return true;
472 } 475 }
OLDNEW
« no previous file with comments | « src/gpu/GrDrawState.h ('k') | src/gpu/GrTextContext.cpp » ('j') | src/gpu/GrTextContext.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698