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

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

Issue 1117433002: Remove GrFlushToGpuDrawTarget and move functionality up to GrDrawTarget. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: more Created 5 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 unified diff | Download patch
« no previous file with comments | « src/gpu/GrTargetCommands.h ('k') | no next file » | 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 "GrTargetCommands.h" 8 #include "GrTargetCommands.h"
9 9
10 #include "GrColor.h" 10 #include "GrColor.h"
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 } 334 }
335 335
336 void GrTargetCommands::ClearStencilClip::execute(GrGpu* gpu, const SetState*) { 336 void GrTargetCommands::ClearStencilClip::execute(GrGpu* gpu, const SetState*) {
337 gpu->clearStencilClip(fRect, fInsideClip, this->renderTarget()); 337 gpu->clearStencilClip(fRect, fInsideClip, this->renderTarget());
338 } 338 }
339 339
340 void GrTargetCommands::CopySurface::execute(GrGpu* gpu, const SetState*) { 340 void GrTargetCommands::CopySurface::execute(GrGpu* gpu, const SetState*) {
341 gpu->copySurface(this->dst(), this->src(), fSrcRect, fDstPoint); 341 gpu->copySurface(this->dst(), this->src(), fSrcRect, fDstPoint);
342 } 342 }
343 343
344 GrTargetCommands::Cmd* GrTargetCommands::recordCopySurface(GrInOrderDrawBuffer* iodb, 344 GrTargetCommands::Cmd* GrTargetCommands::recordCopySurface(GrSurface* dst,
345 GrSurface* dst,
346 GrSurface* src, 345 GrSurface* src,
347 const SkIRect& srcRec t, 346 const SkIRect& srcRec t,
348 const SkIPoint& dstPo int) { 347 const SkIPoint& dstPo int) {
349 if (iodb->getGpu()->canCopySurface(dst, src, srcRect, dstPoint)) { 348 CopySurface* cs = GrNEW_APPEND_TO_RECORDER(fCmdBuffer, CopySurface, (dst, sr c));
350 CopySurface* cs = GrNEW_APPEND_TO_RECORDER(fCmdBuffer, CopySurface, (dst , src)); 349 cs->fSrcRect = srcRect;
351 cs->fSrcRect = srcRect; 350 cs->fDstPoint = dstPoint;
352 cs->fDstPoint = dstPoint; 351 return cs;
353 return cs;
354 }
355 return NULL;
356 } 352 }
357 353
358 bool GrTargetCommands::setupPipelineAndShouldDraw(GrInOrderDrawBuffer* iodb, 354 bool GrTargetCommands::setupPipelineAndShouldDraw(GrInOrderDrawBuffer* iodb,
359 const GrPrimitiveProcessor* pr imProc, 355 const GrPrimitiveProcessor* pr imProc,
360 const GrDrawTarget::PipelineIn fo& pipelineInfo) { 356 const GrDrawTarget::PipelineIn fo& pipelineInfo) {
361 SetState* ss = GrNEW_APPEND_TO_RECORDER(fCmdBuffer, SetState, (primProc)); 357 SetState* ss = GrNEW_APPEND_TO_RECORDER(fCmdBuffer, SetState, (primProc));
362 iodb->setupPipeline(pipelineInfo, ss->pipelineLocation()); 358 iodb->setupPipeline(pipelineInfo, ss->pipelineLocation());
363 359
364 if (ss->getPipeline()->mustSkip()) { 360 if (ss->getPipeline()->mustSkip()) {
365 fCmdBuffer.pop_back(); 361 fCmdBuffer.pop_back();
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 if (fPrevState && !fPrevState->fPrimitiveProcessor.get() && 394 if (fPrevState && !fPrevState->fPrimitiveProcessor.get() &&
399 fPrevState->getPipeline()->isEqual(*ss->getPipeline())) { 395 fPrevState->getPipeline()->isEqual(*ss->getPipeline())) {
400 fCmdBuffer.pop_back(); 396 fCmdBuffer.pop_back();
401 } else { 397 } else {
402 fPrevState = ss; 398 fPrevState = ss;
403 iodb->recordTraceMarkersIfNecessary(ss); 399 iodb->recordTraceMarkersIfNecessary(ss);
404 } 400 }
405 return true; 401 return true;
406 } 402 }
407 403
OLDNEW
« no previous file with comments | « src/gpu/GrTargetCommands.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698