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

Side by Side Diff: src/gpu/GrGpu.h

Issue 695873002: small fix for clip mask cache clear (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: more cleanup Created 6 years, 1 month 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
« no previous file with comments | « src/gpu/GrDrawTarget.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef GrGpu_DEFINED 8 #ifndef GrGpu_DEFINED
9 #define GrGpu_DEFINED 9 #define GrGpu_DEFINED
10 10
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 // GrDrawTarget overrides 268 // GrDrawTarget overrides
269 virtual void clear(const SkIRect* rect, 269 virtual void clear(const SkIRect* rect,
270 GrColor color, 270 GrColor color,
271 bool canIgnoreRect, 271 bool canIgnoreRect,
272 GrRenderTarget* renderTarget = NULL) SK_OVERRIDE; 272 GrRenderTarget* renderTarget = NULL) SK_OVERRIDE;
273 273
274 virtual void clearStencilClip(const SkIRect& rect, 274 virtual void clearStencilClip(const SkIRect& rect,
275 bool insideClip, 275 bool insideClip,
276 GrRenderTarget* renderTarget = NULL) SK_OVERRI DE; 276 GrRenderTarget* renderTarget = NULL) SK_OVERRI DE;
277 277
278 virtual void purgeResources() SK_OVERRIDE {
279 // The clip mask manager can rebuild all its clip masks so just
280 // get rid of them all.
281 fClipMaskManager.purgeResources();
282 }
283
284 // After the client interacts directly with the 3D context state the GrGpu 278 // After the client interacts directly with the 3D context state the GrGpu
285 // must resync its internal state and assumptions about 3D context state. 279 // must resync its internal state and assumptions about 3D context state.
286 // Each time this occurs the GrGpu bumps a timestamp. 280 // Each time this occurs the GrGpu bumps a timestamp.
287 // state of the 3D context 281 // state of the 3D context
288 // At 10 resets / frame and 60fps a 64bit timestamp will overflow in about 282 // At 10 resets / frame and 60fps a 64bit timestamp will overflow in about
289 // a billion years. 283 // a billion years.
290 typedef uint64_t ResetTimestamp; 284 typedef uint64_t ResetTimestamp;
291 285
292 // This timestamp is always older than the current timestamp 286 // This timestamp is always older than the current timestamp
293 static const ResetTimestamp kExpiredTimestamp = 0; 287 static const ResetTimestamp kExpiredTimestamp = 0;
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 virtual void onDrawPaths(const GrPathRange*, 458 virtual void onDrawPaths(const GrPathRange*,
465 const uint32_t indices[], int count, 459 const uint32_t indices[], int count,
466 const float transforms[], PathTransformType, 460 const float transforms[], PathTransformType,
467 SkPath::FillType, const GrDeviceCoordTexture*) SK_O VERRIDE; 461 SkPath::FillType, const GrDeviceCoordTexture*) SK_O VERRIDE;
468 462
469 // readies the pools to provide vertex/index data. 463 // readies the pools to provide vertex/index data.
470 void prepareVertexPool(); 464 void prepareVertexPool();
471 void prepareIndexPool(); 465 void prepareIndexPool();
472 466
473 void resetContext() { 467 void resetContext() {
474 // We call this because the client may have messed with the
475 // stencil buffer. Perhaps we should detect whether it is a
476 // internally created stencil buffer and if so skip the invalidate.
477 fClipMaskManager.invalidateStencilMask();
478 this->onResetContext(fResetBits); 468 this->onResetContext(fResetBits);
479 fResetBits = 0; 469 fResetBits = 0;
480 ++fResetTimestamp; 470 ++fResetTimestamp;
481 } 471 }
482 472
483 void handleDirtyContext() { 473 void handleDirtyContext() {
484 if (fResetBits) { 474 if (fResetBits) {
485 this->resetContext(); 475 this->resetContext();
486 } 476 }
487 } 477 }
488 478
489 enum { 479 enum {
490 kPreallocGeomPoolStateStackCnt = 4, 480 kPreallocGeomPoolStateStackCnt = 4,
491 }; 481 };
492 SkSTArray<kPreallocGeomPoolStateStackCnt, GeometryPoolState, true> fGeomPoo lStateStack; 482 SkSTArray<kPreallocGeomPoolStateStackCnt, GeometryPoolState, true> fGeomPoo lStateStack;
493 ResetTimestamp fResetTi mestamp; 483 ResetTimestamp fResetTi mestamp;
494 uint32_t fResetBi ts; 484 uint32_t fResetBi ts;
495 GrVertexBufferAllocPool* fVertexP ool; 485 GrVertexBufferAllocPool* fVertexP ool;
496 GrIndexBufferAllocPool* fIndexPo ol; 486 GrIndexBufferAllocPool* fIndexPo ol;
497 // counts number of uses of vertex/index pool in the geometry stack 487 // counts number of uses of vertex/index pool in the geometry stack
498 int fVertexP oolUseCnt; 488 int fVertexP oolUseCnt;
499 int fIndexPo olUseCnt; 489 int fIndexPo olUseCnt;
500 // these are mutable so they can be created on-demand 490 // these are mutable so they can be created on-demand
501 mutable GrIndexBuffer* fQuadInd exBuffer; 491 mutable GrIndexBuffer* fQuadInd exBuffer;
502 492
503 typedef GrClipTarget INHERITED; 493 typedef GrClipTarget INHERITED;
504 }; 494 };
505 495
506 #endif 496 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrDrawTarget.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698