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

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

Issue 2396953002: Revert[8] "replace SkXfermode obj with SkBlendMode enum in paints" (Closed)
Patch Set: add tmp virtual to unroll legacy arithmodes Created 4 years, 2 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 | « src/gpu/GrContext.cpp ('k') | src/gpu/GrSWMaskHelper.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 2015 Google Inc. 2 * Copyright 2015 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 "GrBatchTest.h" 8 #include "GrBatchTest.h"
9 #include "GrColor.h" 9 #include "GrColor.h"
10 #include "GrDrawContext.h" 10 #include "GrDrawContext.h"
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 // target before the target is read. 234 // target before the target is read.
235 SkRect clearRect = SkRect::MakeIWH(this->width(), this->height()); 235 SkRect clearRect = SkRect::MakeIWH(this->width(), this->height());
236 if (isFull) { 236 if (isFull) {
237 this->discard(); 237 this->discard();
238 } else if (!clearRect.intersect(SkRect::Make(clip.scissorRect()))) { 238 } else if (!clearRect.intersect(SkRect::Make(clip.scissorRect()))) {
239 return; 239 return;
240 } 240 }
241 241
242 GrPaint paint; 242 GrPaint paint;
243 paint.setColor4f(GrColor4f::FromGrColor(color)); 243 paint.setColor4f(GrColor4f::FromGrColor(color));
244 paint.setXPFactory(GrPorterDuffXPFactory::Make(SkXfermode::kSrc_Mode)); 244 paint.setXPFactory(GrPorterDuffXPFactory::Make(SkXfermode::Mode::kSrc_Mo de));
245 245
246 this->drawRect(clip, paint, SkMatrix::I(), clearRect); 246 this->drawRect(clip, paint, SkMatrix::I(), clearRect);
247 } else if (isFull) { 247 } else if (isFull) {
248 this->getDrawTarget()->fullClear(this->accessRenderTarget(), color); 248 this->getDrawTarget()->fullClear(this->accessRenderTarget(), color);
249 } else { 249 } else {
250 sk_sp<GrBatch> batch(GrClearBatch::Make(clip, color, this->accessRenderT arget())); 250 sk_sp<GrBatch> batch(GrClearBatch::Make(clip, color, this->accessRenderT arget()));
251 if (!batch) { 251 if (!batch) {
252 return; 252 return;
253 } 253 }
254 this->getDrawTarget()->addBatch(std::move(batch)); 254 this->getDrawTarget()->addBatch(std::move(batch));
(...skipping 1171 matching lines...) Expand 10 before | Expand all | Expand 10 after
1426 1426
1427 void GrDrawContext::drawBatch(const GrPipelineBuilder& pipelineBuilder, const Gr Clip& clip, 1427 void GrDrawContext::drawBatch(const GrPipelineBuilder& pipelineBuilder, const Gr Clip& clip,
1428 GrDrawBatch* batch) { 1428 GrDrawBatch* batch) {
1429 ASSERT_SINGLE_OWNER 1429 ASSERT_SINGLE_OWNER
1430 RETURN_IF_ABANDONED 1430 RETURN_IF_ABANDONED
1431 SkDEBUGCODE(this->validate();) 1431 SkDEBUGCODE(this->validate();)
1432 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawBatch"); 1432 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawBatch");
1433 1433
1434 this->getDrawTarget()->drawBatch(pipelineBuilder, this, clip, batch); 1434 this->getDrawTarget()->drawBatch(pipelineBuilder, this, clip, batch);
1435 } 1435 }
OLDNEW
« no previous file with comments | « src/gpu/GrContext.cpp ('k') | src/gpu/GrSWMaskHelper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698