| 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 if (GrTexture* rtTex = rt->asTexture()) { | 130 if (GrTexture* rtTex = rt->asTexture()) { |
| 131 // The render target is a texture, so we can read from it directly i
n the shader. The XP | 131 // The render target is a texture, so we can read from it directly i
n the shader. The XP |
| 132 // will be responsible to detect this situation and request a textur
e barrier. | 132 // will be responsible to detect this situation and request a textur
e barrier. |
| 133 dstTexture->setTexture(rtTex); | 133 dstTexture->setTexture(rtTex); |
| 134 dstTexture->setOffset(0, 0); | 134 dstTexture->setOffset(0, 0); |
| 135 return true; | 135 return true; |
| 136 } | 136 } |
| 137 } | 137 } |
| 138 | 138 |
| 139 SkIRect copyRect; | 139 SkIRect copyRect; |
| 140 pipelineBuilder.clip().getConservativeBounds(rt, ©Rect); | 140 pipelineBuilder.clip().getConservativeBounds(rt->width(), rt->height(), &cop
yRect); |
| 141 | 141 |
| 142 SkIRect drawIBounds; | 142 SkIRect drawIBounds; |
| 143 bounds.roundOut(&drawIBounds); | 143 bounds.roundOut(&drawIBounds); |
| 144 if (!copyRect.intersect(drawIBounds)) { | 144 if (!copyRect.intersect(drawIBounds)) { |
| 145 #ifdef SK_DEBUG | 145 #ifdef SK_DEBUG |
| 146 GrCapsDebugf(this->caps(), "Missed an early reject. " | 146 GrCapsDebugf(this->caps(), "Missed an early reject. " |
| 147 "Bailing on draw from setupDstReadIfNecessary
.\n"); | 147 "Bailing on draw from setupDstReadIfNecessary
.\n"); |
| 148 #endif | 148 #endif |
| 149 return false; | 149 return false; |
| 150 } | 150 } |
| (...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 555 } | 555 } |
| 556 | 556 |
| 557 return true; | 557 return true; |
| 558 } | 558 } |
| 559 | 559 |
| 560 void GrDrawTarget::clearStencilClip(const SkIRect& rect, bool insideClip, GrRend
erTarget* rt) { | 560 void GrDrawTarget::clearStencilClip(const SkIRect& rect, bool insideClip, GrRend
erTarget* rt) { |
| 561 GrBatch* batch = new GrClearStencilClipBatch(rect, insideClip, rt); | 561 GrBatch* batch = new GrClearStencilClipBatch(rect, insideClip, rt); |
| 562 this->recordBatch(batch); | 562 this->recordBatch(batch); |
| 563 batch->unref(); | 563 batch->unref(); |
| 564 } | 564 } |
| OLD | NEW |