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 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 | 329 |
330 GrGLIRect fHWViewport; | 330 GrGLIRect fHWViewport; |
331 | 331 |
332 /** | 332 /** |
333 * Tracks bound vertex and index buffers and vertex attrib array state. | 333 * Tracks bound vertex and index buffers and vertex attrib array state. |
334 */ | 334 */ |
335 class HWGeometryState { | 335 class HWGeometryState { |
336 public: | 336 public: |
337 HWGeometryState() { fVBOVertexArray = NULL; this->invalidate(); } | 337 HWGeometryState() { fVBOVertexArray = NULL; this->invalidate(); } |
338 | 338 |
339 ~HWGeometryState() { SkSafeUnref(fVBOVertexArray); } | 339 ~HWGeometryState() { SkDELETE(fVBOVertexArray); } |
340 | 340 |
341 void invalidate() { | 341 void invalidate() { |
342 fBoundVertexArrayIDIsValid = false; | 342 fBoundVertexArrayIDIsValid = false; |
343 fBoundVertexBufferIDIsValid = false; | 343 fBoundVertexBufferIDIsValid = false; |
344 fDefaultVertexArrayBoundIndexBufferID = false; | 344 fDefaultVertexArrayBoundIndexBufferID = false; |
345 fDefaultVertexArrayBoundIndexBufferIDIsValid = false; | 345 fDefaultVertexArrayBoundIndexBufferIDIsValid = false; |
346 fDefaultVertexArrayAttribState.invalidate(); | 346 fDefaultVertexArrayAttribState.invalidate(); |
347 if (fVBOVertexArray) { | 347 if (fVBOVertexArray) { |
348 fVBOVertexArray->invalidateCachedState(); | 348 fVBOVertexArray->invalidateCachedState(); |
349 } | 349 } |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 | 470 |
471 // we record what stencil format worked last time to hopefully exit early | 471 // we record what stencil format worked last time to hopefully exit early |
472 // from our loop that tries stencil formats and calls check fb status. | 472 // from our loop that tries stencil formats and calls check fb status. |
473 int fLastSuccessfulStencilFmtIdx; | 473 int fLastSuccessfulStencilFmtIdx; |
474 | 474 |
475 typedef GrGpu INHERITED; | 475 typedef GrGpu INHERITED; |
476 friend class GrGLPathRendering; // For accessing setTextureUnit. | 476 friend class GrGLPathRendering; // For accessing setTextureUnit. |
477 }; | 477 }; |
478 | 478 |
479 #endif | 479 #endif |
OLD | NEW |