| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2010 Google Inc. | 3 * Copyright 2010 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 #include "GrDrawTarget.h" | 9 #include "GrDrawTarget.h" |
| 10 | 10 |
| (...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 | 424 |
| 425 if (this->caps()->useDrawInsteadOfClear()) { | 425 if (this->caps()->useDrawInsteadOfClear()) { |
| 426 // This works around a driver bug with clear by drawing a rect instead. | 426 // This works around a driver bug with clear by drawing a rect instead. |
| 427 // The driver will ignore a clear if it is the only thing rendered to a | 427 // The driver will ignore a clear if it is the only thing rendered to a |
| 428 // target before the target is read. | 428 // target before the target is read. |
| 429 if (rect == &rtRect) { | 429 if (rect == &rtRect) { |
| 430 this->discard(renderTarget); | 430 this->discard(renderTarget); |
| 431 } | 431 } |
| 432 | 432 |
| 433 GrPipelineBuilder pipelineBuilder; | 433 GrPipelineBuilder pipelineBuilder; |
| 434 pipelineBuilder.setXPFactory( |
| 435 GrPorterDuffXPFactory::Create(SkXfermode::kSrc_Mode))->unref(); |
| 434 pipelineBuilder.setRenderTarget(renderTarget); | 436 pipelineBuilder.setRenderTarget(renderTarget); |
| 435 | 437 |
| 436 this->drawNonAARect(pipelineBuilder, color, SkMatrix::I(), *rect); | 438 this->drawNonAARect(pipelineBuilder, color, SkMatrix::I(), *rect); |
| 437 } else { | 439 } else { |
| 438 GrBatch* batch = new GrClearBatch(*rect, color, renderTarget); | 440 GrBatch* batch = new GrClearBatch(*rect, color, renderTarget); |
| 439 this->recordBatch(batch); | 441 this->recordBatch(batch); |
| 440 batch->unref(); | 442 batch->unref(); |
| 441 } | 443 } |
| 442 } | 444 } |
| 443 | 445 |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 547 } | 549 } |
| 548 | 550 |
| 549 return true; | 551 return true; |
| 550 } | 552 } |
| 551 | 553 |
| 552 void GrDrawTarget::clearStencilClip(const SkIRect& rect, bool insideClip, GrRend
erTarget* rt) { | 554 void GrDrawTarget::clearStencilClip(const SkIRect& rect, bool insideClip, GrRend
erTarget* rt) { |
| 553 GrBatch* batch = new GrClearStencilClipBatch(rect, insideClip, rt); | 555 GrBatch* batch = new GrClearStencilClipBatch(rect, insideClip, rt); |
| 554 this->recordBatch(batch); | 556 this->recordBatch(batch); |
| 555 batch->unref(); | 557 batch->unref(); |
| 556 } | 558 } |
| OLD | NEW |