| 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 #ifndef GrGLGpu_DEFINED | 8 #ifndef GrGLGpu_DEFINED |
| 9 #define GrGLGpu_DEFINED | 9 #define GrGLGpu_DEFINED |
| 10 | 10 |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 | 307 |
| 308 // flushes the scissor. see the note on flushBoundTextureAndParams about | 308 // flushes the scissor. see the note on flushBoundTextureAndParams about |
| 309 // flushing the scissor after that function is called. | 309 // flushing the scissor after that function is called. |
| 310 void flushScissor(const GrScissorState&, | 310 void flushScissor(const GrScissorState&, |
| 311 const GrGLIRect& rtViewport, | 311 const GrGLIRect& rtViewport, |
| 312 GrSurfaceOrigin rtOrigin); | 312 GrSurfaceOrigin rtOrigin); |
| 313 | 313 |
| 314 // disables the scissor | 314 // disables the scissor |
| 315 void disableScissor(); | 315 void disableScissor(); |
| 316 | 316 |
| 317 void flushWindowRectangles(const GrWindowRectangles&, const GrGLRenderTarget
*); |
| 318 void disableWindowRectangles(); |
| 319 |
| 317 void initFSAASupport(); | 320 void initFSAASupport(); |
| 318 | 321 |
| 319 // determines valid stencil formats | 322 // determines valid stencil formats |
| 320 void initStencilFormats(); | 323 void initStencilFormats(); |
| 321 | 324 |
| 322 // sets a texture unit to use for texture operations other than binding a te
xture to a program. | 325 // sets a texture unit to use for texture operations other than binding a te
xture to a program. |
| 323 // ensures that such operations don't negatively interact with tracking boun
d textures. | 326 // ensures that such operations don't negatively interact with tracking boun
d textures. |
| 324 void setScratchTextureUnit(); | 327 void setScratchTextureUnit(); |
| 325 | 328 |
| 326 // bounds is region that may be modified. | 329 // bounds is region that may be modified. |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 // last scissor / viewport scissor state seen by the GL. | 415 // last scissor / viewport scissor state seen by the GL. |
| 413 struct { | 416 struct { |
| 414 TriState fEnabled; | 417 TriState fEnabled; |
| 415 GrGLIRect fRect; | 418 GrGLIRect fRect; |
| 416 void invalidate() { | 419 void invalidate() { |
| 417 fEnabled = kUnknown_TriState; | 420 fEnabled = kUnknown_TriState; |
| 418 fRect.invalidate(); | 421 fRect.invalidate(); |
| 419 } | 422 } |
| 420 } fHWScissorSettings; | 423 } fHWScissorSettings; |
| 421 | 424 |
| 425 class { |
| 426 public: |
| 427 bool valid() const { return kInvalidOrigin != fOrigin; } |
| 428 void invalidate() { fOrigin = kInvalidOrigin; } |
| 429 |
| 430 bool disabled() const { |
| 431 return this->valid() && Mode::kExclusive == fWindows.mode() && !fWin
dows.count(); |
| 432 } |
| 433 void setDisabled() { fOrigin = kDefault_GrSurfaceOrigin, fWindows.reset(
); } |
| 434 |
| 435 bool equal(GrSurfaceOrigin org, const GrGLIRect& viewp, |
| 436 const GrWindowRectangles& windows) const { |
| 437 if (!this->valid()) { |
| 438 return false; |
| 439 } |
| 440 if (fWindows.count() && (fOrigin != org || fViewport != viewp)) { |
| 441 return false; |
| 442 } |
| 443 return fWindows == windows; |
| 444 } |
| 445 |
| 446 void set(GrSurfaceOrigin org, const GrGLIRect& viewp, const GrWindowRect
angles& windows) { |
| 447 fOrigin = org; |
| 448 fViewport = viewp; |
| 449 fWindows = windows; |
| 450 } |
| 451 |
| 452 private: |
| 453 typedef GrWindowRectangles::Mode Mode; |
| 454 enum { kInvalidOrigin = -1 }; |
| 455 |
| 456 int fOrigin; |
| 457 GrGLIRect fViewport; |
| 458 GrWindowRectangles fWindows; |
| 459 } fHWWindowRects; |
| 460 |
| 422 GrGLIRect fHWViewport; | 461 GrGLIRect fHWViewport; |
| 423 | 462 |
| 424 /** | 463 /** |
| 425 * Tracks vertex attrib array state. | 464 * Tracks vertex attrib array state. |
| 426 */ | 465 */ |
| 427 class HWVertexArrayState { | 466 class HWVertexArrayState { |
| 428 public: | 467 public: |
| 429 HWVertexArrayState() : fCoreProfileVertexArray(nullptr) { this->invalida
te(); } | 468 HWVertexArrayState() : fCoreProfileVertexArray(nullptr) { this->invalida
te(); } |
| 430 | 469 |
| 431 ~HWVertexArrayState() { delete fCoreProfileVertexArray; } | 470 ~HWVertexArrayState() { delete fCoreProfileVertexArray; } |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 596 bool fPLSHasBeenUsed; | 635 bool fPLSHasBeenUsed; |
| 597 | 636 |
| 598 float fHWMinSampleShading; | 637 float fHWMinSampleShading; |
| 599 | 638 |
| 600 typedef GrGpu INHERITED; | 639 typedef GrGpu INHERITED; |
| 601 friend class GrGLPathRendering; // For accessing setTextureUnit. | 640 friend class GrGLPathRendering; // For accessing setTextureUnit. |
| 602 friend class gr_instanced::GLInstancedRendering; // For accessing flushGLSta
te. | 641 friend class gr_instanced::GLInstancedRendering; // For accessing flushGLSta
te. |
| 603 }; | 642 }; |
| 604 | 643 |
| 605 #endif | 644 #endif |
| OLD | NEW |