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

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

Issue 302783002: Initial work to get ETC1 data up to the GPU (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix GCC warning Created 6 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
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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 * @param desc describes the texture to be created. 79 * @param desc describes the texture to be created.
80 * @param srcData texel data to load texture. Begins with full-size 80 * @param srcData texel data to load texture. Begins with full-size
81 * palette data for paletted textures. Contains width* 81 * palette data for paletted textures. Contains width*
82 * height texels. If NULL texture data is uninitialized. 82 * height texels. If NULL texture data is uninitialized.
83 * 83 *
84 * @return The texture object if successful, otherwise NULL. 84 * @return The texture object if successful, otherwise NULL.
85 */ 85 */
86 GrTexture* createTexture(const GrTextureDesc& desc, 86 GrTexture* createTexture(const GrTextureDesc& desc,
87 const void* srcData, size_t rowBytes); 87 const void* srcData, size_t rowBytes);
88 88
89 /** 89 /**
robertphillips 2014/05/30 15:00:22 Can we test these cases (on a Xoom say) ?
90 * Creates a compressed texture object. If desc width or height is not a pow er of
91 * two but underlying API requires a power of two texture then this function will
92 * return NULL. If the pixel configuration passed in desc is not a valid for mat
93 * supported by the device, then this function will return NULL.
94 *
95 * The kRenderTarget_TextureFlag should not be specified
96 *
97 * @param desc describes the texture to be created. The width and hei ght of
98 * the texture should be multiples of the block size for the
99 * requested compressed format. The origin of the texture is
100 * also expected to be in the top left.
101 * @param srcData texel data to load texture. This is expected to be the
102 * proper size based on the width and height of the textu re along
103 * with the associated block size specified in GrTextureF ormatDesc
104 *
105 * @return The texture object if successful, otherwise NULL.
106 */
107 GrTexture* createCompressedTexture(const GrTextureDesc& desc, const void* sr cData);
bsalomon 2014/05/30 15:16:58 I'm wondering if this makes sense as a public GrGp
krajcevski 2014/05/30 16:21:50 I agree to an extent... it's always better to be i
108
109 /**
90 * Implements GrContext::wrapBackendTexture 110 * Implements GrContext::wrapBackendTexture
91 */ 111 */
92 GrTexture* wrapBackendTexture(const GrBackendTextureDesc&); 112 GrTexture* wrapBackendTexture(const GrBackendTextureDesc&);
93 113
94 /** 114 /**
95 * Implements GrContext::wrapBackendTexture 115 * Implements GrContext::wrapBackendTexture
96 */ 116 */
97 GrRenderTarget* wrapBackendRenderTarget(const GrBackendRenderTargetDesc&); 117 GrRenderTarget* wrapBackendRenderTarget(const GrBackendRenderTargetDesc&);
98 118
99 /** 119 /**
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 427
408 428
409 // called when the 3D context state is unknown. Subclass should emit any 429 // called when the 3D context state is unknown. Subclass should emit any
410 // assumed 3D context state and dirty any state cache. 430 // assumed 3D context state and dirty any state cache.
411 virtual void onResetContext(uint32_t resetBits) = 0; 431 virtual void onResetContext(uint32_t resetBits) = 0;
412 432
413 // overridden by backend-specific derived class to create objects. 433 // overridden by backend-specific derived class to create objects.
414 virtual GrTexture* onCreateTexture(const GrTextureDesc& desc, 434 virtual GrTexture* onCreateTexture(const GrTextureDesc& desc,
415 const void* srcData, 435 const void* srcData,
416 size_t rowBytes) = 0; 436 size_t rowBytes) = 0;
437 virtual GrTexture* onCreateCompressedTexture(const GrTextureDesc& desc,
438 const void* srcData) = 0;
417 virtual GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&) = 0; 439 virtual GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&) = 0;
418 virtual GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTarge tDesc&) = 0; 440 virtual GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTarge tDesc&) = 0;
419 virtual GrVertexBuffer* onCreateVertexBuffer(size_t size, bool dynamic) = 0; 441 virtual GrVertexBuffer* onCreateVertexBuffer(size_t size, bool dynamic) = 0;
420 virtual GrIndexBuffer* onCreateIndexBuffer(size_t size, bool dynamic) = 0; 442 virtual GrIndexBuffer* onCreateIndexBuffer(size_t size, bool dynamic) = 0;
421 virtual GrPath* onCreatePath(const SkPath& path, const SkStrokeRec&) = 0; 443 virtual GrPath* onCreatePath(const SkPath& path, const SkStrokeRec&) = 0;
422 444
423 // overridden by backend-specific derived class to perform the clear and 445 // overridden by backend-specific derived class to perform the clear and
424 // clearRect. NULL rect means clear whole target. If canIgnoreRect is 446 // clearRect. NULL rect means clear whole target. If canIgnoreRect is
425 // true, it is okay to perform a full clear instead of a partial clear 447 // true, it is okay to perform a full clear instead of a partial clear
426 virtual void onClear(const SkIRect* rect, GrColor color, bool canIgnoreRect) = 0; 448 virtual void onClear(const SkIRect* rect, GrColor color, bool canIgnoreRect) = 0;
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 // these are mutable so they can be created on-demand 536 // these are mutable so they can be created on-demand
515 mutable GrIndexBuffer* fQuadInd exBuffer; 537 mutable GrIndexBuffer* fQuadInd exBuffer;
516 // Used to abandon/release all resources created by this GrGpu. TODO: Move t his 538 // Used to abandon/release all resources created by this GrGpu. TODO: Move t his
517 // functionality to GrResourceCache. 539 // functionality to GrResourceCache.
518 ObjectList fObjectL ist; 540 ObjectList fObjectL ist;
519 541
520 typedef GrDrawTarget INHERITED; 542 typedef GrDrawTarget INHERITED;
521 }; 543 };
522 544
523 #endif 545 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698