OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 | 8 |
9 #include "GrGpuGL.h" | 9 #include "GrGpuGL.h" |
10 #include "GrGLStencilBuffer.h" | 10 #include "GrGLStencilBuffer.h" |
(...skipping 1237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1248 return; | 1248 return; |
1249 } | 1249 } |
1250 } | 1250 } |
1251 if (kNo_TriState != fHWScissorSettings.fEnabled) { | 1251 if (kNo_TriState != fHWScissorSettings.fEnabled) { |
1252 GL_CALL(Disable(GR_GL_SCISSOR_TEST)); | 1252 GL_CALL(Disable(GR_GL_SCISSOR_TEST)); |
1253 fHWScissorSettings.fEnabled = kNo_TriState; | 1253 fHWScissorSettings.fEnabled = kNo_TriState; |
1254 return; | 1254 return; |
1255 } | 1255 } |
1256 } | 1256 } |
1257 | 1257 |
1258 void GrGpuGL::onClear(const SkIRect* rect, GrColor color) { | 1258 void GrGpuGL::onClear(const SkIRect* rect, GrColor color, bool canIgnoreRect) { |
1259 const GrDrawState& drawState = this->getDrawState(); | 1259 const GrDrawState& drawState = this->getDrawState(); |
1260 const GrRenderTarget* rt = drawState.getRenderTarget(); | 1260 const GrRenderTarget* rt = drawState.getRenderTarget(); |
1261 // parent class should never let us get here with no RT | 1261 // parent class should never let us get here with no RT |
1262 SkASSERT(NULL != rt); | 1262 SkASSERT(NULL != rt); |
1263 | 1263 |
| 1264 if (canIgnoreRect && this->glCaps().fullClearIsFree()) { |
| 1265 rect = NULL; |
| 1266 } |
| 1267 |
1264 SkIRect clippedRect; | 1268 SkIRect clippedRect; |
1265 if (NULL != rect) { | 1269 if (NULL != rect) { |
1266 // flushScissor expects rect to be clipped to the target. | 1270 // flushScissor expects rect to be clipped to the target. |
1267 clippedRect = *rect; | 1271 clippedRect = *rect; |
1268 SkIRect rtRect = SkIRect::MakeWH(rt->width(), rt->height()); | 1272 SkIRect rtRect = SkIRect::MakeWH(rt->width(), rt->height()); |
1269 if (clippedRect.intersect(rtRect)) { | 1273 if (clippedRect.intersect(rtRect)) { |
1270 rect = &clippedRect; | 1274 rect = &clippedRect; |
1271 } else { | 1275 } else { |
1272 return; | 1276 return; |
1273 } | 1277 } |
(...skipping 1399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2673 this->setVertexArrayID(gpu, 0); | 2677 this->setVertexArrayID(gpu, 0); |
2674 } | 2678 } |
2675 int attrCount = gpu->glCaps().maxVertexAttributes(); | 2679 int attrCount = gpu->glCaps().maxVertexAttributes(); |
2676 if (fDefaultVertexArrayAttribState.count() != attrCount) { | 2680 if (fDefaultVertexArrayAttribState.count() != attrCount) { |
2677 fDefaultVertexArrayAttribState.resize(attrCount); | 2681 fDefaultVertexArrayAttribState.resize(attrCount); |
2678 } | 2682 } |
2679 attribState = &fDefaultVertexArrayAttribState; | 2683 attribState = &fDefaultVertexArrayAttribState; |
2680 } | 2684 } |
2681 return attribState; | 2685 return attribState; |
2682 } | 2686 } |
OLD | NEW |