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 "GrGLGpu.h" | 9 #include "GrGLGpu.h" |
10 #include "GrGLGLSL.h" | 10 #include "GrGLGLSL.h" |
(...skipping 2299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2310 bool enableSRGBWrite = GrPixelConfigIsSRGB(target->config()); | 2310 bool enableSRGBWrite = GrPixelConfigIsSRGB(target->config()); |
2311 if (enableSRGBWrite && kYes_TriState != fHWSRGBFramebuffer) { | 2311 if (enableSRGBWrite && kYes_TriState != fHWSRGBFramebuffer) { |
2312 GL_CALL(Enable(GR_GL_FRAMEBUFFER_SRGB)); | 2312 GL_CALL(Enable(GR_GL_FRAMEBUFFER_SRGB)); |
2313 fHWSRGBFramebuffer = kYes_TriState; | 2313 fHWSRGBFramebuffer = kYes_TriState; |
2314 } else if (!enableSRGBWrite && kNo_TriState != fHWSRGBFramebuffer) { | 2314 } else if (!enableSRGBWrite && kNo_TriState != fHWSRGBFramebuffer) { |
2315 GL_CALL(Disable(GR_GL_FRAMEBUFFER_SRGB)); | 2315 GL_CALL(Disable(GR_GL_FRAMEBUFFER_SRGB)); |
2316 fHWSRGBFramebuffer = kNo_TriState; | 2316 fHWSRGBFramebuffer = kNo_TriState; |
2317 } | 2317 } |
2318 } | 2318 } |
2319 } | 2319 } |
| 2320 |
| 2321 // Mark any MIP chain and resolve buffer as dirty if and only if there is a
non-empty bounds. |
2320 if (nullptr == bound || !bound->isEmpty()) { | 2322 if (nullptr == bound || !bound->isEmpty()) { |
2321 target->flagAsNeedingResolve(bound); | 2323 target->flagAsNeedingResolve(bound); |
2322 } | 2324 if (GrTexture *texture = target->asTexture()) { |
2323 | 2325 texture->texturePriv().dirtyMipMaps(true); |
2324 GrTexture *texture = target->asTexture(); | 2326 } |
2325 if (texture) { | |
2326 texture->texturePriv().dirtyMipMaps(true); | |
2327 } | 2327 } |
2328 } | 2328 } |
2329 | 2329 |
2330 GrGLenum gPrimitiveType2GLMode[] = { | 2330 GrGLenum gPrimitiveType2GLMode[] = { |
2331 GR_GL_TRIANGLES, | 2331 GR_GL_TRIANGLES, |
2332 GR_GL_TRIANGLE_STRIP, | 2332 GR_GL_TRIANGLE_STRIP, |
2333 GR_GL_TRIANGLE_FAN, | 2333 GR_GL_TRIANGLE_FAN, |
2334 GR_GL_POINTS, | 2334 GR_GL_POINTS, |
2335 GR_GL_LINES, | 2335 GR_GL_LINES, |
2336 GR_GL_LINE_STRIP | 2336 GR_GL_LINE_STRIP |
(...skipping 1371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3708 if (GR_GL_TEXTURE_EXTERNAL == glTexture->target() || | 3708 if (GR_GL_TEXTURE_EXTERNAL == glTexture->target() || |
3709 GR_GL_TEXTURE_RECTANGLE == glTexture->target()) { | 3709 GR_GL_TEXTURE_RECTANGLE == glTexture->target()) { |
3710 copyParams->fFilter = GrTextureParams::kNone_FilterMode; | 3710 copyParams->fFilter = GrTextureParams::kNone_FilterMode; |
3711 copyParams->fWidth = texture->width(); | 3711 copyParams->fWidth = texture->width(); |
3712 copyParams->fHeight = texture->height(); | 3712 copyParams->fHeight = texture->height(); |
3713 return true; | 3713 return true; |
3714 } | 3714 } |
3715 } | 3715 } |
3716 return false; | 3716 return false; |
3717 } | 3717 } |
OLD | NEW |