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

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 some code clarity issues 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 /**
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.
93 *
94 * The kRenderTarget_TextureFlag should not be specified
95 *
96 * @param desc describes the texture to be created.
robertphillips 2014/05/27 22:01:50 Mention its compressedness ?
krajcevski 2014/05/27 22:19:29 Done.
97 * @param srcData texel data to load texture. The size of the data is ex pected
98 * to be large enough to hold as much data as the format expects
99 * with respect to the width and height.
robertphillips 2014/05/27 22:01:50 format ?
krajcevski 2014/05/27 22:19:29 Done.
krajcevski 2014/05/27 22:19:29 Done.
100 *
101 * @return The texture object if successful, otherwise NULL.
102 */
103 GrTexture* createCompressedTexture(const GrTextureDesc& desc,
104 const void* srcData, GrCompressedFormat f ormat);
105
106 /**
90 * Implements GrContext::wrapBackendTexture 107 * Implements GrContext::wrapBackendTexture
91 */ 108 */
92 GrTexture* wrapBackendTexture(const GrBackendTextureDesc&); 109 GrTexture* wrapBackendTexture(const GrBackendTextureDesc&);
93 110
94 /** 111 /**
95 * Implements GrContext::wrapBackendTexture 112 * Implements GrContext::wrapBackendTexture
96 */ 113 */
97 GrRenderTarget* wrapBackendRenderTarget(const GrBackendRenderTargetDesc&); 114 GrRenderTarget* wrapBackendRenderTarget(const GrBackendRenderTargetDesc&);
98 115
99 /** 116 /**
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 424
408 425
409 // called when the 3D context state is unknown. Subclass should emit any 426 // called when the 3D context state is unknown. Subclass should emit any
410 // assumed 3D context state and dirty any state cache. 427 // assumed 3D context state and dirty any state cache.
411 virtual void onResetContext(uint32_t resetBits) = 0; 428 virtual void onResetContext(uint32_t resetBits) = 0;
412 429
413 // overridden by backend-specific derived class to create objects. 430 // overridden by backend-specific derived class to create objects.
414 virtual GrTexture* onCreateTexture(const GrTextureDesc& desc, 431 virtual GrTexture* onCreateTexture(const GrTextureDesc& desc,
415 const void* srcData, 432 const void* srcData,
416 size_t rowBytes) = 0; 433 size_t rowBytes) = 0;
434 virtual GrTexture* onCreateCompressedTexture(const GrTextureDesc& desc,
435 const void* srcData,
436 GrCompressedFormat format) = 0;
417 virtual GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&) = 0; 437 virtual GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&) = 0;
418 virtual GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTarge tDesc&) = 0; 438 virtual GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTarge tDesc&) = 0;
419 virtual GrVertexBuffer* onCreateVertexBuffer(size_t size, bool dynamic) = 0; 439 virtual GrVertexBuffer* onCreateVertexBuffer(size_t size, bool dynamic) = 0;
420 virtual GrIndexBuffer* onCreateIndexBuffer(size_t size, bool dynamic) = 0; 440 virtual GrIndexBuffer* onCreateIndexBuffer(size_t size, bool dynamic) = 0;
421 virtual GrPath* onCreatePath(const SkPath& path, const SkStrokeRec&) = 0; 441 virtual GrPath* onCreatePath(const SkPath& path, const SkStrokeRec&) = 0;
422 442
423 // overridden by backend-specific derived class to perform the clear and 443 // overridden by backend-specific derived class to perform the clear and
424 // clearRect. NULL rect means clear whole target. If canIgnoreRect is 444 // 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 445 // 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; 446 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 534 // these are mutable so they can be created on-demand
515 mutable GrIndexBuffer* fQuadInd exBuffer; 535 mutable GrIndexBuffer* fQuadInd exBuffer;
516 // Used to abandon/release all resources created by this GrGpu. TODO: Move t his 536 // Used to abandon/release all resources created by this GrGpu. TODO: Move t his
517 // functionality to GrResourceCache. 537 // functionality to GrResourceCache.
518 ObjectList fObjectL ist; 538 ObjectList fObjectL ist;
519 539
520 typedef GrDrawTarget INHERITED; 540 typedef GrDrawTarget INHERITED;
521 }; 541 };
522 542
523 #endif 543 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698