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

Unified Diff: src/gpu/gl/GrGpuGL.cpp

Issue 809843002: Remove GrGpu::flushGraphicsState (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/gl/GrGpuGL.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGpuGL.cpp
diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp
index 2965cd4007c6bfaaab7f424142a35b2e0b6bd4f4..0c134ce35801eb0700f2afab47f4241fb78acd50 100644
--- a/src/gpu/gl/GrGpuGL.cpp
+++ b/src/gpu/gl/GrGpuGL.cpp
@@ -1344,7 +1344,7 @@ void GrGLGpu::flushScissor(const GrClipMaskManager::ScissorState& scissorState,
this->disableScissor();
}
-bool GrGLGpu::flushGraphicsState(const GrOptDrawState& optState) {
+bool GrGLGpu::flushGLState(const GrOptDrawState& optState) {
// GrGpu::setupClipAndFlushState should have already checked this and bailed if not true.
SkASSERT(optState.getRenderTarget());
@@ -1834,6 +1834,10 @@ GrGLenum gPrimitiveType2GLMode[] = {
#endif
void GrGLGpu::onDraw(const GrOptDrawState& ds, const GrDrawTarget::DrawInfo& info) {
+ if (!this->flushGLState(ds)) {
+ return;
+ }
+
size_t indexOffsetInBytes;
this->setupGeometry(ds, info, &indexOffsetInBytes);
@@ -1867,6 +1871,38 @@ void GrGLGpu::onDraw(const GrOptDrawState& ds, const GrDrawTarget::DrawInfo& inf
#endif
}
+void GrGLGpu::onStencilPath(const GrOptDrawState& ds,
+ const GrPath* path,
+ const GrStencilSettings& stencil) {
+ if (!this->flushGLState(ds)) {
+ return;
+ }
+ fPathRendering->stencilPath(path, stencil);
+}
+
+void GrGLGpu::onDrawPath(const GrOptDrawState& ds, const GrPath* path,
+ const GrStencilSettings& stencil) {
+ if (!this->flushGLState(ds)) {
+ return;
+ }
+ fPathRendering->drawPath(path, stencil);
+}
+
+void GrGLGpu::onDrawPaths(const GrOptDrawState& ds,
+ const GrPathRange* pathRange,
+ const void* indices,
+ GrDrawTarget::PathIndexType indexType,
+ const float transformValues[],
+ GrDrawTarget::PathTransformType transformType,
+ int count,
+ const GrStencilSettings& stencil) {
+ if (!this->flushGLState(ds)) {
+ return;
+ }
+ fPathRendering->drawPaths(pathRange, indices, indexType, transformValues,
+ transformType, count, stencil);
+}
+
void GrGLGpu::onResolveRenderTarget(GrRenderTarget* target) {
GrGLRenderTarget* rt = static_cast<GrGLRenderTarget*>(target);
if (rt->needsResolve()) {
« no previous file with comments | « src/gpu/gl/GrGpuGL.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698