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

Side by Side Diff: include/gpu/GrTypes.h

Issue 1862043002: Refactor to separate backend object lifecycle and GpuResource budget decision (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove verbosity Created 4 years, 8 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
« no previous file with comments | « include/gpu/GrTexture.h ('k') | src/gpu/GrGpu.h » ('j') | 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 2010 Google Inc. 2 * Copyright 2010 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 GrTypes_DEFINED 8 #ifndef GrTypes_DEFINED
9 #define GrTypes_DEFINED 9 #define GrTypes_DEFINED
10 10
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 * should be verified. 418 * should be verified.
419 */ 419 */
420 kCheckAllocation_GrSurfaceFlag = 0x4, 420 kCheckAllocation_GrSurfaceFlag = 0x4,
421 }; 421 };
422 422
423 GR_MAKE_BITFIELD_OPS(GrSurfaceFlags) 423 GR_MAKE_BITFIELD_OPS(GrSurfaceFlags)
424 424
425 // opaque type for 3D API object handles 425 // opaque type for 3D API object handles
426 typedef intptr_t GrBackendObject; 426 typedef intptr_t GrBackendObject;
427 427
428 enum class GrBackendObjectOwnership : bool {
Kimmo Kinnunen 2016/04/20 13:59:03 I guess now this is quite similar to below..
bsalomon 2016/04/20 15:48:03 Looking at the latest CL I think it makes sense to
429 /** Holder does not destroy the backend object. */
430 kBorrowed = false,
431 /** Holder destroys the backend object. */
432 kOwned = true
433 };
434
428 /** 435 /**
429 * Some textures will be stored such that the upper and left edges of the conten t meet at the 436 * Some textures will be stored such that the upper and left edges of the conten t meet at the
430 * the origin (in texture coord space) and for other textures the lower and left edges meet at 437 * the origin (in texture coord space) and for other textures the lower and left edges meet at
431 * the origin. kDefault_GrSurfaceOrigin sets textures to TopLeft, and render tar gets 438 * the origin. kDefault_GrSurfaceOrigin sets textures to TopLeft, and render tar gets
432 * to BottomLeft. 439 * to BottomLeft.
433 */ 440 */
434 441
435 enum GrSurfaceOrigin { 442 enum GrSurfaceOrigin {
436 kDefault_GrSurfaceOrigin, // DEPRECATED; to be removed 443 kDefault_GrSurfaceOrigin, // DEPRECATED; to be removed
437 kTopLeft_GrSurfaceOrigin, 444 kTopLeft_GrSurfaceOrigin,
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 */ 494 */
488 enum GrClipType { 495 enum GrClipType {
489 kRect_ClipType, 496 kRect_ClipType,
490 kPath_ClipType 497 kPath_ClipType
491 }; 498 };
492 499
493 /////////////////////////////////////////////////////////////////////////////// 500 ///////////////////////////////////////////////////////////////////////////////
494 501
495 502
496 /** Ownership rules for external GPU resources imported into Skia. */ 503 /** Ownership rules for external GPU resources imported into Skia. */
497 enum GrWrapOwnership { 504 enum GrWrapOwnership {
Kimmo Kinnunen 2016/04/20 13:59:03 .. similar to this. The docstrings will be confusi
498 /** Skia will assume the client will keep the resource alive and Skia will n ot free it. */ 505 /** Skia will assume the client will keep the resource alive and Skia will n ot free it. */
499 kBorrow_GrWrapOwnership, 506 kBorrow_GrWrapOwnership,
500 507
501 /** Skia will assume ownership of the resource and free it. */ 508 /** Skia will assume ownership of the resource and free it. */
502 kAdopt_GrWrapOwnership, 509 kAdopt_GrWrapOwnership,
503 }; 510 };
504 511
505 /** 512 /**
506 * Gr can wrap an existing texture created by the client with a GrTexture 513 * Gr can wrap an existing texture created by the client with a GrTexture
507 * object. The client is responsible for ensuring that the texture lives at 514 * object. The client is responsible for ensuring that the texture lives at
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
638 return 4 * width * height; 645 return 4 * width * height;
639 } 646 }
640 } 647 }
641 648
642 /** 649 /**
643 * This value translates to reseting all the context state for any backend. 650 * This value translates to reseting all the context state for any backend.
644 */ 651 */
645 static const uint32_t kAll_GrBackendState = 0xffffffff; 652 static const uint32_t kAll_GrBackendState = 0xffffffff;
646 653
647 #endif 654 #endif
OLDNEW
« no previous file with comments | « include/gpu/GrTexture.h ('k') | src/gpu/GrGpu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698