Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 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 "GrVkPipeline.h" | 8 #include "GrVkPipeline.h" |
| 9 | 9 |
| 10 #include "GrGeometryProcessor.h" | 10 #include "GrGeometryProcessor.h" |
| (...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 499 scissor.extent.width = scissorState.rect().width(); | 499 scissor.extent.width = scissorState.rect().width(); |
| 500 if (kTopLeft_GrSurfaceOrigin == target.origin()) { | 500 if (kTopLeft_GrSurfaceOrigin == target.origin()) { |
| 501 scissor.offset.y = scissorState.rect().fTop; | 501 scissor.offset.y = scissorState.rect().fTop; |
| 502 } else { | 502 } else { |
| 503 SkASSERT(kBottomLeft_GrSurfaceOrigin == target.origin()); | 503 SkASSERT(kBottomLeft_GrSurfaceOrigin == target.origin()); |
| 504 scissor.offset.y = target.height() - scissorState.rect().fBottom; | 504 scissor.offset.y = target.height() - scissorState.rect().fBottom; |
| 505 } | 505 } |
| 506 scissor.extent.height = scissorState.rect().height(); | 506 scissor.extent.height = scissorState.rect().height(); |
| 507 | 507 |
| 508 SkASSERT(scissor.offset.x >= 0); | 508 SkASSERT(scissor.offset.x >= 0); |
| 509 SkASSERT(scissor.offset.x + scissor.extent.width <= (uint32_t)target.wid th()); | |
| 510 SkASSERT(scissor.offset.y >= 0); | 509 SkASSERT(scissor.offset.y >= 0); |
| 511 SkASSERT(scissor.offset.y + scissor.extent.height <= (uint32_t)target.he ight()); | |
|
csmartdalton
2016/07/22 20:54:48
Ah, looks my change gave you grief. I also removed
| |
| 512 } else { | 510 } else { |
| 513 scissor.extent.width = target.width(); | 511 scissor.extent.width = target.width(); |
| 514 scissor.extent.height = target.height(); | 512 scissor.extent.height = target.height(); |
| 515 scissor.offset.x = 0; | 513 scissor.offset.x = 0; |
| 516 scissor.offset.y = 0; | 514 scissor.offset.y = 0; |
| 517 } | 515 } |
| 518 cmdBuffer->setScissor(gpu, 0, 1, &scissor); | 516 cmdBuffer->setScissor(gpu, 0, 1, &scissor); |
| 519 } | 517 } |
| 520 | 518 |
| 521 void set_dynamic_viewport_state(GrVkGpu* gpu, | 519 void set_dynamic_viewport_state(GrVkGpu* gpu, |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 549 } | 547 } |
| 550 | 548 |
| 551 void GrVkPipeline::SetDynamicState(GrVkGpu* gpu, | 549 void GrVkPipeline::SetDynamicState(GrVkGpu* gpu, |
| 552 GrVkCommandBuffer* cmdBuffer, | 550 GrVkCommandBuffer* cmdBuffer, |
| 553 const GrPipeline& pipeline) { | 551 const GrPipeline& pipeline) { |
| 554 const GrRenderTarget& target = *pipeline.getRenderTarget(); | 552 const GrRenderTarget& target = *pipeline.getRenderTarget(); |
| 555 set_dynamic_scissor_state(gpu, cmdBuffer, pipeline, target); | 553 set_dynamic_scissor_state(gpu, cmdBuffer, pipeline, target); |
| 556 set_dynamic_viewport_state(gpu, cmdBuffer, target); | 554 set_dynamic_viewport_state(gpu, cmdBuffer, target); |
| 557 set_dynamic_blend_constant_state(gpu, cmdBuffer, pipeline); | 555 set_dynamic_blend_constant_state(gpu, cmdBuffer, pipeline); |
| 558 } | 556 } |
| OLD | NEW |