Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(113)

Side by Side Diff: src/gpu/gl/GrGLGpu.cpp

Issue 2251573002: Implement difference clip rects with window rectangles (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: return type Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #include "GrGLGpu.h" 8 #include "GrGLGpu.h"
9 #include "GrGLBuffer.h" 9 #include "GrGLBuffer.h"
10 #include "GrGLGLSL.h" 10 #include "GrGLGLSL.h"
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 fHWBufferTextures[b].fKnownBound = false; 556 fHWBufferTextures[b].fKnownBound = false;
557 } 557 }
558 } 558 }
559 559
560 if (resetBits & kBlend_GrGLBackendState) { 560 if (resetBits & kBlend_GrGLBackendState) {
561 fHWBlendState.invalidate(); 561 fHWBlendState.invalidate();
562 } 562 }
563 563
564 if (resetBits & kView_GrGLBackendState) { 564 if (resetBits & kView_GrGLBackendState) {
565 fHWScissorSettings.invalidate(); 565 fHWScissorSettings.invalidate();
566 fHWWindowRects.invalidate();
566 fHWViewport.invalidate(); 567 fHWViewport.invalidate();
567 } 568 }
568 569
569 if (resetBits & kStencil_GrGLBackendState) { 570 if (resetBits & kStencil_GrGLBackendState) {
570 fHWStencilSettings.invalidate(); 571 fHWStencilSettings.invalidate();
571 fHWStencilTestEnabled = kUnknown_TriState; 572 fHWStencilTestEnabled = kUnknown_TriState;
572 } 573 }
573 574
574 // Vertex 575 // Vertex
575 if (resetBits & kVertex_GrGLBackendState) { 576 if (resetBits & kVertex_GrGLBackendState) {
(...skipping 1412 matching lines...) Expand 10 before | Expand all | Expand 10 after
1988 fHWScissorSettings.fEnabled = kYes_TriState; 1989 fHWScissorSettings.fEnabled = kYes_TriState;
1989 } 1990 }
1990 return; 1991 return;
1991 } 1992 }
1992 } 1993 }
1993 1994
1994 // See fall through note above 1995 // See fall through note above
1995 this->disableScissor(); 1996 this->disableScissor();
1996 } 1997 }
1997 1998
1999 void GrGLGpu::flushWindowRectangles(const GrWindowRectangles& windows, const GrG LRenderTarget* rt) {
2000 typedef GrWindowRectangles::Mode Mode;
2001 SkASSERT(windows.count() <= this->caps()->maxWindowRectangles());
2002 SkASSERT(windows.disabled() || rt->renderFBOID()); // Window rectangles can' t be used on-screen.
2003
2004 if (!this->caps()->maxWindowRectangles() ||
2005 fHWWindowRects.equal(rt->origin(), rt->getViewport(), windows)) {
2006 return;
2007
2008 }
2009
2010 GrGLIRect glwindows[GrWindowRectangles::kMaxWindows];
2011 const SkIRect* skwindows = windows.data();
2012 for (int i = 0; i < windows.count(); ++i) {
2013 glwindows[i].setRelativeTo(rt->getViewport(), skwindows[i], rt->origin() );
2014 }
2015
2016 GrGLenum glmode = (Mode::kExclusive == windows.mode()) ? GR_GL_EXCLUSIVE : G R_GL_INCLUSIVE;
2017 GL_CALL(WindowRectangles(glmode, windows.count(), glwindows->asInts()));
2018
2019 fHWWindowRects.set(rt->origin(), rt->getViewport(), windows);
2020 }
2021
2022 void GrGLGpu::disableWindowRectangles() {
2023 if (!this->caps()->maxWindowRectangles() || fHWWindowRects.disabled()) {
2024 return;
2025 }
2026 GL_CALL(WindowRectangles(GR_GL_EXCLUSIVE, 0, nullptr));
2027 fHWWindowRects.setDisabled();
2028 }
2029
1998 void GrGLGpu::flushMinSampleShading(float minSampleShading) { 2030 void GrGLGpu::flushMinSampleShading(float minSampleShading) {
1999 if (fHWMinSampleShading != minSampleShading) { 2031 if (fHWMinSampleShading != minSampleShading) {
2000 if (minSampleShading > 0.0) { 2032 if (minSampleShading > 0.0) {
2001 GL_CALL(Enable(GR_GL_SAMPLE_SHADING)); 2033 GL_CALL(Enable(GR_GL_SAMPLE_SHADING));
2002 GL_CALL(MinSampleShading(minSampleShading)); 2034 GL_CALL(MinSampleShading(minSampleShading));
2003 } 2035 }
2004 else { 2036 else {
2005 GL_CALL(Disable(GR_GL_SAMPLE_SHADING)); 2037 GL_CALL(Disable(GR_GL_SAMPLE_SHADING));
2006 } 2038 }
2007 fHWMinSampleShading = minSampleShading; 2039 fHWMinSampleShading = minSampleShading;
(...skipping 27 matching lines...) Expand all
2035 const GrSwizzle& swizzle = this->glCaps().glslCaps()->configOutputSwizzl e( 2067 const GrSwizzle& swizzle = this->glCaps().glslCaps()->configOutputSwizzl e(
2036 pipeline.getRenderTarget()->config()); 2068 pipeline.getRenderTarget()->config());
2037 this->flushBlend(blendInfo, swizzle); 2069 this->flushBlend(blendInfo, swizzle);
2038 } 2070 }
2039 2071
2040 program->setData(primProc, pipeline); 2072 program->setData(primProc, pipeline);
2041 2073
2042 GrGLRenderTarget* glRT = static_cast<GrGLRenderTarget*>(pipeline.getRenderTa rget()); 2074 GrGLRenderTarget* glRT = static_cast<GrGLRenderTarget*>(pipeline.getRenderTa rget());
2043 this->flushStencil(pipeline.getStencil()); 2075 this->flushStencil(pipeline.getStencil());
2044 this->flushScissor(pipeline.getScissorState(), glRT->getViewport(), glRT->or igin()); 2076 this->flushScissor(pipeline.getScissorState(), glRT->getViewport(), glRT->or igin());
2077 this->flushWindowRectangles(pipeline.getWindowRectangles(), glRT);
2045 this->flushHWAAState(glRT, pipeline.isHWAntialiasState(), !pipeline.getStenc il().isDisabled()); 2078 this->flushHWAAState(glRT, pipeline.isHWAntialiasState(), !pipeline.getStenc il().isDisabled());
2046 2079
2047 // This must come after textures are flushed because a texture may need 2080 // This must come after textures are flushed because a texture may need
2048 // to be msaa-resolved (which will modify bound FBO state). 2081 // to be msaa-resolved (which will modify bound FBO state).
2049 this->flushRenderTarget(glRT, nullptr, pipeline.getDisableOutputConversionTo SRGB()); 2082 this->flushRenderTarget(glRT, nullptr, pipeline.getDisableOutputConversionTo SRGB());
2050 2083
2051 return true; 2084 return true;
2052 } 2085 }
2053 2086
2054 void GrGLGpu::setupGeometry(const GrPrimitiveProcessor& primProc, 2087 void GrGLGpu::setupGeometry(const GrPrimitiveProcessor& primProc,
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
2164 this->handleDirtyContext(); 2197 this->handleDirtyContext();
2165 2198
2166 // parent class should never let us get here with no RT 2199 // parent class should never let us get here with no RT
2167 SkASSERT(target); 2200 SkASSERT(target);
2168 GrGLRenderTarget* glRT = static_cast<GrGLRenderTarget*>(target); 2201 GrGLRenderTarget* glRT = static_cast<GrGLRenderTarget*>(target);
2169 2202
2170 this->flushRenderTarget(glRT, &rect); 2203 this->flushRenderTarget(glRT, &rect);
2171 GrScissorState scissorState; 2204 GrScissorState scissorState;
2172 scissorState.set(rect); 2205 scissorState.set(rect);
2173 this->flushScissor(scissorState, glRT->getViewport(), glRT->origin()); 2206 this->flushScissor(scissorState, glRT->getViewport(), glRT->origin());
2207 this->disableWindowRectangles();
2174 2208
2175 GrGLfloat r, g, b, a; 2209 GrGLfloat r, g, b, a;
2176 static const GrGLfloat scale255 = 1.f / 255.f; 2210 static const GrGLfloat scale255 = 1.f / 255.f;
2177 a = GrColorUnpackA(color) * scale255; 2211 a = GrColorUnpackA(color) * scale255;
2178 GrGLfloat scaleRGB = scale255; 2212 GrGLfloat scaleRGB = scale255;
2179 r = GrColorUnpackR(color) * scaleRGB; 2213 r = GrColorUnpackR(color) * scaleRGB;
2180 g = GrColorUnpackG(color) * scaleRGB; 2214 g = GrColorUnpackG(color) * scaleRGB;
2181 b = GrColorUnpackB(color) * scaleRGB; 2215 b = GrColorUnpackB(color) * scaleRGB;
2182 2216
2183 GL_CALL(ColorMask(GR_GL_TRUE, GR_GL_TRUE, GR_GL_TRUE, GR_GL_TRUE)); 2217 GL_CALL(ColorMask(GR_GL_TRUE, GR_GL_TRUE, GR_GL_TRUE, GR_GL_TRUE));
2184 fHWWriteToColor = kYes_TriState; 2218 fHWWriteToColor = kYes_TriState;
2185 GL_CALL(ClearColor(r, g, b, a)); 2219 GL_CALL(ClearColor(r, g, b, a));
2186 GL_CALL(Clear(GR_GL_COLOR_BUFFER_BIT)); 2220 GL_CALL(Clear(GR_GL_COLOR_BUFFER_BIT));
2187 } 2221 }
2188 2222
2189 void GrGLGpu::clearStencil(GrRenderTarget* target) { 2223 void GrGLGpu::clearStencil(GrRenderTarget* target) {
2190 if (nullptr == target) { 2224 if (nullptr == target) {
2191 return; 2225 return;
2192 } 2226 }
2193 GrGLRenderTarget* glRT = static_cast<GrGLRenderTarget*>(target); 2227 GrGLRenderTarget* glRT = static_cast<GrGLRenderTarget*>(target);
2194 this->flushRenderTarget(glRT, &SkIRect::EmptyIRect()); 2228 this->flushRenderTarget(glRT, &SkIRect::EmptyIRect());
2195 2229
2196 this->disableScissor(); 2230 this->disableScissor();
2231 this->disableWindowRectangles();
2197 2232
2198 GL_CALL(StencilMask(0xffffffff)); 2233 GL_CALL(StencilMask(0xffffffff));
2199 GL_CALL(ClearStencil(0)); 2234 GL_CALL(ClearStencil(0));
2200 GL_CALL(Clear(GR_GL_STENCIL_BUFFER_BIT)); 2235 GL_CALL(Clear(GR_GL_STENCIL_BUFFER_BIT));
2201 fHWStencilSettings.invalidate(); 2236 fHWStencilSettings.invalidate();
2202 } 2237 }
2203 2238
2204 void GrGLGpu::clearStencilClip(const SkIRect& rect, bool insideClip, GrRenderTar get* target) { 2239 void GrGLGpu::clearStencilClip(const SkIRect& rect, bool insideClip, GrRenderTar get* target) {
2205 SkASSERT(target); 2240 SkASSERT(target);
2206 this->handleDirtyContext(); 2241 this->handleDirtyContext();
(...skipping 19 matching lines...) Expand all
2226 value = (1 << (stencilBitCount - 1)); 2261 value = (1 << (stencilBitCount - 1));
2227 } else { 2262 } else {
2228 value = 0; 2263 value = 0;
2229 } 2264 }
2230 GrGLRenderTarget* glRT = static_cast<GrGLRenderTarget*>(target); 2265 GrGLRenderTarget* glRT = static_cast<GrGLRenderTarget*>(target);
2231 this->flushRenderTarget(glRT, &SkIRect::EmptyIRect()); 2266 this->flushRenderTarget(glRT, &SkIRect::EmptyIRect());
2232 2267
2233 GrScissorState scissorState; 2268 GrScissorState scissorState;
2234 scissorState.set(rect); 2269 scissorState.set(rect);
2235 this->flushScissor(scissorState, glRT->getViewport(), glRT->origin()); 2270 this->flushScissor(scissorState, glRT->getViewport(), glRT->origin());
2271 this->disableWindowRectangles();
2236 2272
2237 GL_CALL(StencilMask((uint32_t) clipStencilMask)); 2273 GL_CALL(StencilMask((uint32_t) clipStencilMask));
2238 GL_CALL(ClearStencil(value)); 2274 GL_CALL(ClearStencil(value));
2239 GL_CALL(Clear(GR_GL_STENCIL_BUFFER_BIT)); 2275 GL_CALL(Clear(GR_GL_STENCIL_BUFFER_BIT));
2240 fHWStencilSettings.invalidate(); 2276 fHWStencilSettings.invalidate();
2241 } 2277 }
2242 2278
2243 static bool read_pixels_pays_for_y_flip(GrRenderTarget* renderTarget, const GrGL Caps& caps, 2279 static bool read_pixels_pays_for_y_flip(GrRenderTarget* renderTarget, const GrGL Caps& caps,
2244 int width, int height, GrPixelConfig co nfig, 2280 int width, int height, GrPixelConfig co nfig,
2245 size_t rowBytes) { 2281 size_t rowBytes) {
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
2596 } 2632 }
2597 2633
2598 void GrGLGpu::finishDrawTarget() { 2634 void GrGLGpu::finishDrawTarget() {
2599 if (fPLSHasBeenUsed) { 2635 if (fPLSHasBeenUsed) {
2600 /* There is an ARM driver bug where if we use PLS, and then draw a frame which does not 2636 /* There is an ARM driver bug where if we use PLS, and then draw a frame which does not
2601 * use PLS, it leaves garbage all over the place. As a workaround, we us e PLS in a 2637 * use PLS, it leaves garbage all over the place. As a workaround, we us e PLS in a
2602 * trivial way every frame. And since we use it every frame, there's nev er a point at which 2638 * trivial way every frame. And since we use it every frame, there's nev er a point at which
2603 * it becomes safe to stop using this workaround once we start. 2639 * it becomes safe to stop using this workaround once we start.
2604 */ 2640 */
2605 this->disableScissor(); 2641 this->disableScissor();
2642 this->disableWindowRectangles();
2606 // using PLS in the presence of MSAA results in GL_INVALID_OPERATION 2643 // using PLS in the presence of MSAA results in GL_INVALID_OPERATION
2607 this->flushHWAAState(nullptr, false, false); 2644 this->flushHWAAState(nullptr, false, false);
2608 SkASSERT(!fHWPLSEnabled); 2645 SkASSERT(!fHWPLSEnabled);
2609 SkASSERT(fMSAAEnabled != kYes_TriState); 2646 SkASSERT(fMSAAEnabled != kYes_TriState);
2610 GL_CALL(Enable(GR_GL_SHADER_PIXEL_LOCAL_STORAGE)); 2647 GL_CALL(Enable(GR_GL_SHADER_PIXEL_LOCAL_STORAGE));
2611 this->stampPLSSetupRect(SkRect::MakeXYWH(-100.0f, -100.0f, 0.01f, 0.01f) ); 2648 this->stampPLSSetupRect(SkRect::MakeXYWH(-100.0f, -100.0f, 0.01f, 0.01f) );
2612 GL_CALL(Disable(GR_GL_SHADER_PIXEL_LOCAL_STORAGE)); 2649 GL_CALL(Disable(GR_GL_SHADER_PIXEL_LOCAL_STORAGE));
2613 } 2650 }
2614 } 2651 }
2615 2652
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
2745 } while ((nonIdxMesh = iter.next())); 2782 } while ((nonIdxMesh = iter.next()));
2746 } 2783 }
2747 2784
2748 if (fHWPLSEnabled && plsState == GrPixelLocalStorageState::kFinish_GrPixelLo calStorageState) { 2785 if (fHWPLSEnabled && plsState == GrPixelLocalStorageState::kFinish_GrPixelLo calStorageState) {
2749 // PLS draws always involve multiple draws, finishing up with a non-PLS 2786 // PLS draws always involve multiple draws, finishing up with a non-PLS
2750 // draw that writes to the color buffer. That draw ends up here; we wait 2787 // draw that writes to the color buffer. That draw ends up here; we wait
2751 // until after it is complete to actually disable PLS. 2788 // until after it is complete to actually disable PLS.
2752 GL_CALL(Disable(GR_GL_SHADER_PIXEL_LOCAL_STORAGE)); 2789 GL_CALL(Disable(GR_GL_SHADER_PIXEL_LOCAL_STORAGE));
2753 fHWPLSEnabled = false; 2790 fHWPLSEnabled = false;
2754 this->disableScissor(); 2791 this->disableScissor();
2792 this->disableWindowRectangles();
2755 } 2793 }
2756 2794
2757 #if SWAP_PER_DRAW 2795 #if SWAP_PER_DRAW
2758 glFlush(); 2796 glFlush();
2759 #if defined(SK_BUILD_FOR_MAC) 2797 #if defined(SK_BUILD_FOR_MAC)
2760 aglSwapBuffers(aglGetCurrentContext()); 2798 aglSwapBuffers(aglGetCurrentContext());
2761 int set_a_break_pt_here = 9; 2799 int set_a_break_pt_here = 9;
2762 aglSwapBuffers(aglGetCurrentContext()); 2800 aglSwapBuffers(aglGetCurrentContext());
2763 #elif defined(SK_BUILD_FOR_WIN32) 2801 #elif defined(SK_BUILD_FOR_WIN32)
2764 SwapBuf(); 2802 SwapBuf();
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
2841 // the bound DRAW FBO ID. 2879 // the bound DRAW FBO ID.
2842 fHWBoundRenderTargetUniqueID = SK_InvalidUniqueID; 2880 fHWBoundRenderTargetUniqueID = SK_InvalidUniqueID;
2843 const GrGLIRect& vp = rt->getViewport(); 2881 const GrGLIRect& vp = rt->getViewport();
2844 const SkIRect dirtyRect = rt->getResolveRect(); 2882 const SkIRect dirtyRect = rt->getResolveRect();
2845 2883
2846 if (GrGLCaps::kES_Apple_MSFBOType == this->glCaps().msFBOType()) { 2884 if (GrGLCaps::kES_Apple_MSFBOType == this->glCaps().msFBOType()) {
2847 // Apple's extension uses the scissor as the blit bounds. 2885 // Apple's extension uses the scissor as the blit bounds.
2848 GrScissorState scissorState; 2886 GrScissorState scissorState;
2849 scissorState.set(dirtyRect); 2887 scissorState.set(dirtyRect);
2850 this->flushScissor(scissorState, vp, rt->origin()); 2888 this->flushScissor(scissorState, vp, rt->origin());
2889 this->disableWindowRectangles();
2851 GL_CALL(ResolveMultisampleFramebuffer()); 2890 GL_CALL(ResolveMultisampleFramebuffer());
2852 } else { 2891 } else {
2853 GrGLIRect r; 2892 GrGLIRect r;
2854 r.setRelativeTo(vp, dirtyRect.fLeft, dirtyRect.fTop, 2893 r.setRelativeTo(vp, dirtyRect.fLeft, dirtyRect.fTop,
2855 dirtyRect.width(), dirtyRect.height(), target->o rigin()); 2894 dirtyRect.width(), dirtyRect.height(), target->o rigin());
2856 2895
2857 int right = r.fLeft + r.fWidth; 2896 int right = r.fLeft + r.fWidth;
2858 int top = r.fBottom + r.fHeight; 2897 int top = r.fBottom + r.fHeight;
2859 2898
2860 // BlitFrameBuffer respects the scissor, so disable it. 2899 // BlitFrameBuffer respects the scissor, so disable it.
2861 this->disableScissor(); 2900 this->disableScissor();
2901 this->disableWindowRectangles();
2862 GL_CALL(BlitFramebuffer(r.fLeft, r.fBottom, right, top, 2902 GL_CALL(BlitFramebuffer(r.fLeft, r.fBottom, right, top,
2863 r.fLeft, r.fBottom, right, top, 2903 r.fLeft, r.fBottom, right, top,
2864 GR_GL_COLOR_BUFFER_BIT, GR_GL_NEAREST)); 2904 GR_GL_COLOR_BUFFER_BIT, GR_GL_NEAREST));
2865 } 2905 }
2866 } 2906 }
2867 rt->flagAsResolved(); 2907 rt->flagAsResolved();
2868 } 2908 }
2869 } 2909 }
2870 2910
2871 namespace { 2911 namespace {
(...skipping 1212 matching lines...) Expand 10 before | Expand all | Expand 10 after
4084 GL_CALL(Uniform4fv(fWireRectProgram.fRectUniform, 1, edges)); 4124 GL_CALL(Uniform4fv(fWireRectProgram.fRectUniform, 1, edges));
4085 GL_CALL(Uniform4fv(fWireRectProgram.fColorUniform, 1, channels)); 4125 GL_CALL(Uniform4fv(fWireRectProgram.fColorUniform, 1, channels));
4086 4126
4087 GrXferProcessor::BlendInfo blendInfo; 4127 GrXferProcessor::BlendInfo blendInfo;
4088 blendInfo.reset(); 4128 blendInfo.reset();
4089 this->flushBlend(blendInfo, GrSwizzle::RGBA()); 4129 this->flushBlend(blendInfo, GrSwizzle::RGBA());
4090 this->flushColorWrite(true); 4130 this->flushColorWrite(true);
4091 this->flushDrawFace(GrDrawFace::kBoth); 4131 this->flushDrawFace(GrDrawFace::kBoth);
4092 this->flushHWAAState(glRT, false, false); 4132 this->flushHWAAState(glRT, false, false);
4093 this->disableScissor(); 4133 this->disableScissor();
4134 this->disableWindowRectangles();
4094 GrStencilSettings stencil; 4135 GrStencilSettings stencil;
4095 stencil.setDisabled(); 4136 stencil.setDisabled();
4096 this->flushStencil(stencil); 4137 this->flushStencil(stencil);
4097 4138
4098 GL_CALL(DrawArrays(GR_GL_LINE_LOOP, 0, 4)); 4139 GL_CALL(DrawArrays(GR_GL_LINE_LOOP, 0, 4));
4099 } 4140 }
4100 4141
4101 4142
4102 bool GrGLGpu::copySurfaceAsDraw(GrSurface* dst, 4143 bool GrGLGpu::copySurfaceAsDraw(GrSurface* dst,
4103 GrSurface* src, 4144 GrSurface* src,
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
4172 sx1 - sx0, sy1 - sy0, sx0, sy0)); 4213 sx1 - sx0, sy1 - sy0, sx0, sy0));
4173 GL_CALL(Uniform1i(fCopyPrograms[progIdx].fTextureUniform, 0)); 4214 GL_CALL(Uniform1i(fCopyPrograms[progIdx].fTextureUniform, 0));
4174 4215
4175 GrXferProcessor::BlendInfo blendInfo; 4216 GrXferProcessor::BlendInfo blendInfo;
4176 blendInfo.reset(); 4217 blendInfo.reset();
4177 this->flushBlend(blendInfo, GrSwizzle::RGBA()); 4218 this->flushBlend(blendInfo, GrSwizzle::RGBA());
4178 this->flushColorWrite(true); 4219 this->flushColorWrite(true);
4179 this->flushDrawFace(GrDrawFace::kBoth); 4220 this->flushDrawFace(GrDrawFace::kBoth);
4180 this->flushHWAAState(nullptr, false, false); 4221 this->flushHWAAState(nullptr, false, false);
4181 this->disableScissor(); 4222 this->disableScissor();
4223 this->disableWindowRectangles();
4182 GrStencilSettings stencil; 4224 GrStencilSettings stencil;
4183 stencil.setDisabled(); 4225 stencil.setDisabled();
4184 this->flushStencil(stencil); 4226 this->flushStencil(stencil);
4185 4227
4186 GL_CALL(DrawArrays(GR_GL_TRIANGLE_STRIP, 0, 4)); 4228 GL_CALL(DrawArrays(GR_GL_TRIANGLE_STRIP, 0, 4));
4187 this->unbindTextureFBOForCopy(GR_GL_FRAMEBUFFER, dst); 4229 this->unbindTextureFBOForCopy(GR_GL_FRAMEBUFFER, dst);
4188 this->didWriteToSurface(dst, &dstRect); 4230 this->didWriteToSurface(dst, &dstRect);
4189 4231
4190 return true; 4232 return true;
4191 } 4233 }
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
4256 src->origin()); 4298 src->origin());
4257 dstGLRect.setRelativeTo(dstVP, 4299 dstGLRect.setRelativeTo(dstVP,
4258 dstRect.fLeft, 4300 dstRect.fLeft,
4259 dstRect.fTop, 4301 dstRect.fTop,
4260 dstRect.width(), 4302 dstRect.width(),
4261 dstRect.height(), 4303 dstRect.height(),
4262 dst->origin()); 4304 dst->origin());
4263 4305
4264 // BlitFrameBuffer respects the scissor, so disable it. 4306 // BlitFrameBuffer respects the scissor, so disable it.
4265 this->disableScissor(); 4307 this->disableScissor();
4308 this->disableWindowRectangles();
4266 4309
4267 GrGLint srcY0; 4310 GrGLint srcY0;
4268 GrGLint srcY1; 4311 GrGLint srcY1;
4269 // Does the blit need to y-mirror or not? 4312 // Does the blit need to y-mirror or not?
4270 if (src->origin() == dst->origin()) { 4313 if (src->origin() == dst->origin()) {
4271 srcY0 = srcGLRect.fBottom; 4314 srcY0 = srcGLRect.fBottom;
4272 srcY1 = srcGLRect.fBottom + srcGLRect.fHeight; 4315 srcY1 = srcGLRect.fBottom + srcGLRect.fHeight;
4273 } else { 4316 } else {
4274 srcY0 = srcGLRect.fBottom + srcGLRect.fHeight; 4317 srcY0 = srcGLRect.fBottom + srcGLRect.fHeight;
4275 srcY1 = srcGLRect.fBottom; 4318 srcY1 = srcGLRect.fBottom;
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
4380 attribs->disableUnusedArrays(this, 0x1); 4423 attribs->disableUnusedArrays(this, 0x1);
4381 4424
4382 // Set "simple" state once: 4425 // Set "simple" state once:
4383 GrXferProcessor::BlendInfo blendInfo; 4426 GrXferProcessor::BlendInfo blendInfo;
4384 blendInfo.reset(); 4427 blendInfo.reset();
4385 this->flushBlend(blendInfo, GrSwizzle::RGBA()); 4428 this->flushBlend(blendInfo, GrSwizzle::RGBA());
4386 this->flushColorWrite(true); 4429 this->flushColorWrite(true);
4387 this->flushDrawFace(GrDrawFace::kBoth); 4430 this->flushDrawFace(GrDrawFace::kBoth);
4388 this->flushHWAAState(nullptr, false, false); 4431 this->flushHWAAState(nullptr, false, false);
4389 this->disableScissor(); 4432 this->disableScissor();
4433 this->disableWindowRectangles();
4390 GrStencilSettings stencil; 4434 GrStencilSettings stencil;
4391 stencil.setDisabled(); 4435 stencil.setDisabled();
4392 this->flushStencil(stencil); 4436 this->flushStencil(stencil);
4393 4437
4394 // Do all the blits: 4438 // Do all the blits:
4395 width = texture->width(); 4439 width = texture->width();
4396 height = texture->height(); 4440 height = texture->height();
4397 GrGLIRect viewport; 4441 GrGLIRect viewport;
4398 viewport.fLeft = 0; 4442 viewport.fLeft = 0;
4399 viewport.fBottom = 0; 4443 viewport.fBottom = 0;
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
4613 if (GR_GL_TEXTURE_EXTERNAL == glTexture->target() || 4657 if (GR_GL_TEXTURE_EXTERNAL == glTexture->target() ||
4614 GR_GL_TEXTURE_RECTANGLE == glTexture->target()) { 4658 GR_GL_TEXTURE_RECTANGLE == glTexture->target()) {
4615 copyParams->fFilter = GrTextureParams::kNone_FilterMode; 4659 copyParams->fFilter = GrTextureParams::kNone_FilterMode;
4616 copyParams->fWidth = texture->width(); 4660 copyParams->fWidth = texture->width();
4617 copyParams->fHeight = texture->height(); 4661 copyParams->fHeight = texture->height();
4618 return true; 4662 return true;
4619 } 4663 }
4620 } 4664 }
4621 return false; 4665 return false;
4622 } 4666 }
OLDNEW
« src/gpu/GrCaps.cpp ('K') | « src/gpu/gl/GrGLGpu.h ('k') | src/gpu/gl/GrGLIRect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698