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

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

Issue 2237633003: Avoid creating full screen clear batches when there is already one in the queue. (Closed) Base URL: https://chromium.googlesource.com/skia.git@clear
Patch Set: formatting and comment Created 4 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/GrDrawTarget.h » ('j') | src/gpu/batches/GrClearBatch.h » ('J')
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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 } 226 }
227 227
228 GrPaint paint; 228 GrPaint paint;
229 paint.setColor4f(GrColor4f::FromGrColor(color)); 229 paint.setColor4f(GrColor4f::FromGrColor(color));
230 paint.setXPFactory(GrPorterDuffXPFactory::Make(SkXfermode::kSrc_Mode)); 230 paint.setXPFactory(GrPorterDuffXPFactory::Make(SkXfermode::kSrc_Mode));
231 231
232 this->drawRect(GrNoClip(), paint, SkMatrix::I(), SkRect::Make(*rect)); 232 this->drawRect(GrNoClip(), paint, SkMatrix::I(), SkRect::Make(*rect));
233 } else if (isFull) { 233 } else if (isFull) {
234 this->getDrawTarget()->fullClear(this->accessRenderTarget(), color); 234 this->getDrawTarget()->fullClear(this->accessRenderTarget(), color);
235 } else { 235 } else {
236 sk_sp<GrBatch> batch = GrClearBatch::Make(*rect, color, this->accessRend erTarget()); 236 sk_sp<GrBatch> batch = sk_sp<GrBatch>(
237 GrClearBatch::Create(*rect, color, this->accessRenderTarget()));
237 this->getDrawTarget()->addBatch(std::move(batch)); 238 this->getDrawTarget()->addBatch(std::move(batch));
238 } 239 }
239 } 240 }
240 241
241 242
242 void GrDrawContext::drawPaint(const GrClip& clip, 243 void GrDrawContext::drawPaint(const GrClip& clip,
243 const GrPaint& origPaint, 244 const GrPaint& origPaint,
244 const SkMatrix& viewMatrix) { 245 const SkMatrix& viewMatrix) {
245 ASSERT_SINGLE_OWNER 246 ASSERT_SINGLE_OWNER
246 RETURN_IF_ABANDONED 247 RETURN_IF_ABANDONED
(...skipping 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after
1307 1308
1308 void GrDrawContext::drawBatch(const GrPipelineBuilder& pipelineBuilder, const Gr Clip& clip, 1309 void GrDrawContext::drawBatch(const GrPipelineBuilder& pipelineBuilder, const Gr Clip& clip,
1309 GrDrawBatch* batch) { 1310 GrDrawBatch* batch) {
1310 ASSERT_SINGLE_OWNER 1311 ASSERT_SINGLE_OWNER
1311 RETURN_IF_ABANDONED 1312 RETURN_IF_ABANDONED
1312 SkDEBUGCODE(this->validate();) 1313 SkDEBUGCODE(this->validate();)
1313 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawBatch"); 1314 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawBatch");
1314 1315
1315 this->getDrawTarget()->drawBatch(pipelineBuilder, this, clip, batch); 1316 this->getDrawTarget()->drawBatch(pipelineBuilder, this, clip, batch);
1316 } 1317 }
OLDNEW
« no previous file with comments | « no previous file | src/gpu/GrDrawTarget.h » ('j') | src/gpu/batches/GrClearBatch.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698