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

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

Issue 1187523005: Add support for creating texture backed images where Skia will delete the texture. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add default param to support Chrome's current callers Created 5 years, 6 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/GrTextureProvider.h ('k') | include/gpu/gl/GrGLFunctions.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 /* 2 /*
3 * Copyright 2010 Google Inc. 3 * Copyright 2010 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #ifndef GrTypes_DEFINED 9 #ifndef GrTypes_DEFINED
10 #define GrTypes_DEFINED 10 #define GrTypes_DEFINED
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 enum GrClipType { 467 enum GrClipType {
468 kRect_ClipType, 468 kRect_ClipType,
469 kPath_ClipType 469 kPath_ClipType
470 }; 470 };
471 471
472 /////////////////////////////////////////////////////////////////////////////// 472 ///////////////////////////////////////////////////////////////////////////////
473 473
474 // opaque type for 3D API object handles 474 // opaque type for 3D API object handles
475 typedef intptr_t GrBackendObject; 475 typedef intptr_t GrBackendObject;
476 476
477
478 /** Ownership rules for external GPU resources imported into Skia. */
479 enum GrWrapOwnership {
480 /** Skia will assume the client will keep the resource alive and Skia will n ot free it. */
481 kBorrow_GrWrapOwnership,
482
483 /** Skia will assume ownership of the resource and free it. */
484 kAdopt_GrWrapOwnership,
485 };
486
477 /** 487 /**
478 * Gr can wrap an existing texture created by the client with a GrTexture 488 * Gr can wrap an existing texture created by the client with a GrTexture
479 * object. The client is responsible for ensuring that the texture lives at 489 * object. The client is responsible for ensuring that the texture lives at
480 * least as long as the GrTexture object wrapping it. We require the client to 490 * least as long as the GrTexture object wrapping it. We require the client to
481 * explicitly provide information about the texture, such as width, height, 491 * explicitly provide information about the texture, such as width, height,
482 * and pixel config, rather than querying the 3D APIfor these values. We expect 492 * and pixel config, rather than querying the 3D APIfor these values. We expect
483 * these to be immutable even if the 3D API doesn't require this (OpenGL). 493 * these to be immutable even if the 3D API doesn't require this (OpenGL).
484 * 494 *
485 * Textures that are also render targets are supported as well. Gr will manage 495 * Textures that are also render targets are supported as well. Gr will manage
486 * any ancillary 3D API (stencil buffer, FBO id, etc) objects necessary for 496 * any ancillary 3D API (stencil buffer, FBO id, etc) objects necessary for
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 return 4 * width * height; 620 return 4 * width * height;
611 } 621 }
612 } 622 }
613 623
614 /** 624 /**
615 * This value translates to reseting all the context state for any backend. 625 * This value translates to reseting all the context state for any backend.
616 */ 626 */
617 static const uint32_t kAll_GrBackendState = 0xffffffff; 627 static const uint32_t kAll_GrBackendState = 0xffffffff;
618 628
619 #endif 629 #endif
OLDNEW
« no previous file with comments | « include/gpu/GrTextureProvider.h ('k') | include/gpu/gl/GrGLFunctions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698