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 2472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2483 } | 2483 } |
2484 if (srcFBO) { | 2484 if (srcFBO) { |
2485 GL_CALL(DeleteFramebuffers(1, &srcFBO)); | 2485 GL_CALL(DeleteFramebuffers(1, &srcFBO)); |
2486 } | 2486 } |
2487 copied = true; | 2487 copied = true; |
2488 } | 2488 } |
2489 } | 2489 } |
2490 return copied; | 2490 return copied; |
2491 } | 2491 } |
2492 | 2492 |
2493 bool GrGpuGL::canCopySurface(GrSurface* dst, | 2493 bool GrGpuGL::canCopySurface(const GrSurface* dst, |
2494 GrSurface* src, | 2494 const GrSurface* src, |
2495 const SkIRect& srcRect, | 2495 const SkIRect& srcRect, |
2496 const SkIPoint& dstPoint) { | 2496 const SkIPoint& dstPoint) { |
2497 // This mirrors the logic in onCopySurface. We prefer our base makes the co
py if we need to | 2497 // This mirrors the logic in onCopySurface. We prefer our base makes the co
py if we need to |
2498 // create a temp fbo | 2498 // create a temp fbo |
2499 // TODO verify this assumption, it may not be true at all | 2499 // TODO verify this assumption, it may not be true at all |
2500 bool wouldNeedTempFBO = false; | 2500 bool wouldNeedTempFBO = false; |
2501 if (can_copy_texsubimage(dst, src, this, &wouldNeedTempFBO) && !wouldNeedTem
pFBO) { | 2501 if (can_copy_texsubimage(dst, src, this, &wouldNeedTempFBO) && !wouldNeedTem
pFBO) { |
2502 return true; | 2502 return true; |
2503 } | 2503 } |
2504 if (can_blit_framebuffer(dst, src, this, &wouldNeedTempFBO) && !wouldNeedTem
pFBO) { | 2504 if (can_blit_framebuffer(dst, src, this, &wouldNeedTempFBO) && !wouldNeedTem
pFBO) { |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2555 this->setVertexArrayID(gpu, 0); | 2555 this->setVertexArrayID(gpu, 0); |
2556 } | 2556 } |
2557 int attrCount = gpu->glCaps().maxVertexAttributes(); | 2557 int attrCount = gpu->glCaps().maxVertexAttributes(); |
2558 if (fDefaultVertexArrayAttribState.count() != attrCount) { | 2558 if (fDefaultVertexArrayAttribState.count() != attrCount) { |
2559 fDefaultVertexArrayAttribState.resize(attrCount); | 2559 fDefaultVertexArrayAttribState.resize(attrCount); |
2560 } | 2560 } |
2561 attribState = &fDefaultVertexArrayAttribState; | 2561 attribState = &fDefaultVertexArrayAttribState; |
2562 } | 2562 } |
2563 return attribState; | 2563 return attribState; |
2564 } | 2564 } |
OLD | NEW |