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

Unified Diff: src/gpu/GrDrawState.cpp

Issue 15821008: Make GrContext track the current matrix, render target, and clip directly rather than using GrDrawS… (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: put back wideopen check Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
« src/gpu/GrContext.cpp ('K') | « src/gpu/GrDrawState.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDrawState.cpp
diff --git a/src/gpu/GrDrawState.cpp b/src/gpu/GrDrawState.cpp
index a3850b087e7abcabbdcc45ce65c07124a29bc3c2..2cc50f7dc463c7a3c5511d3d278433275b414e55 100644
--- a/src/gpu/GrDrawState.cpp
+++ b/src/gpu/GrDrawState.cpp
@@ -8,7 +8,7 @@
#include "GrDrawState.h"
#include "GrPaint.h"
-void GrDrawState::setFromPaint(const GrPaint& paint) {
+void GrDrawState::setFromPaint(const GrPaint& paint, const SkMatrix& vm, GrRenderTarget* rt) {
for (int i = 0; i < GrPaint::kMaxColorStages; ++i) {
int s = i + GrPaint::kFirstColorStage;
if (paint.isColorStageEnabled(i)) {
@@ -34,8 +34,18 @@ void GrDrawState::setFromPaint(const GrPaint& paint) {
this->disableStage(s);
}
- this->setColor(paint.getColor());
+ this->setRenderTarget(rt);
+
+ fCommon.fViewMatrix = vm;
+ // These have no equivalent in GrPaint, set them to defaults
+ fCommon.fBlendConstant = 0x0;
+ fCommon.fCoverage = 0xffffffff;
+ fCommon.fDrawFace = kBoth_DrawFace;
+ fCommon.fStencilSettings.setDisabled();
+ this->resetStateFlags();
+
+ this->setColor(paint.getColor());
this->setState(GrDrawState::kDither_StateBit, paint.isDither());
this->setState(GrDrawState::kHWAntialias_StateBit, paint.isAntiAlias());
« src/gpu/GrContext.cpp ('K') | « src/gpu/GrDrawState.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698