| OLD | NEW |
| 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 * For compressed formats the level contains the compress
ed pixel data. | 89 * For compressed formats the level contains the compress
ed pixel data. |
| 90 * Otherwise, it contains width*height texels. If there i
s only one | 90 * Otherwise, it contains width*height texels. If there i
s only one |
| 91 * element and it contains nullptr fPixels, texture data
is | 91 * element and it contains nullptr fPixels, texture data
is |
| 92 * uninitialized. | 92 * uninitialized. |
| 93 * @return The texture object if successful, otherwise nullptr. | 93 * @return The texture object if successful, otherwise nullptr. |
| 94 */ | 94 */ |
| 95 GrTexture* createTexture(const GrSurfaceDesc& desc, SkBudgeted budgeted, | 95 GrTexture* createTexture(const GrSurfaceDesc& desc, SkBudgeted budgeted, |
| 96 const SkTArray<GrMipLevel>& texels); | 96 const SkTArray<GrMipLevel>& texels); |
| 97 | 97 |
| 98 /** | 98 /** |
| 99 * Simplified createTexture() interface when there is no initial texel data | 99 * This function is a shim which creates a SkTArGrMipLevell> of size 1. |
| 100 * to upload. | 100 * It then calls createTexture with that SkTArray. |
| 101 * |
| 102 * @param srcData texel data to load texture. Begins with full-size |
| 103 * palette data for paletted texture. For compressed |
| 104 * formats it contains the compressed pixel data. Otherwise, |
| 105 * it contains width*height texels. If nullptr texture data |
| 106 * is uninitialized. |
| 107 * @param rowBytes the number of bytes between consecutive rows. Zero |
| 108 * means rows are tightly packed. This field is ignored |
| 109 * for compressed pixel formats. |
| 110 * @return The texture object if successful, otherwise, nullptr. |
| 101 */ | 111 */ |
| 102 GrTexture* createTexture(const GrSurfaceDesc& desc, SkBudgeted budgeted) { | 112 GrTexture* createTexture(const GrSurfaceDesc& desc, SkBudgeted budgeted, |
| 103 return this->createTexture(desc, budgeted, SkTArray<GrMipLevel>()); | 113 const void* srcData, size_t rowBytes); |
| 104 } | 114 |
| 105 | |
| 106 /** | 115 /** |
| 107 * Implements GrTextureProvider::wrapBackendTexture | 116 * Implements GrTextureProvider::wrapBackendTexture |
| 108 */ | 117 */ |
| 109 GrTexture* wrapBackendTexture(const GrBackendTextureDesc&, GrWrapOwnership); | 118 GrTexture* wrapBackendTexture(const GrBackendTextureDesc&, GrWrapOwnership); |
| 110 | 119 |
| 111 /** | 120 /** |
| 112 * Implements GrTextureProvider::wrapBackendRenderTarget | 121 * Implements GrTextureProvider::wrapBackendRenderTarget |
| 113 */ | 122 */ |
| 114 GrRenderTarget* wrapBackendRenderTarget(const GrBackendRenderTargetDesc&, Gr
WrapOwnership); | 123 GrRenderTarget* wrapBackendRenderTarget(const GrBackendRenderTargetDesc&, Gr
WrapOwnership); |
| 115 | 124 |
| (...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 601 ResetTimestamp fResetTi
mestamp; | 610 ResetTimestamp fResetTi
mestamp; |
| 602 uint32_t fResetBi
ts; | 611 uint32_t fResetBi
ts; |
| 603 // The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu. | 612 // The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu. |
| 604 GrContext* fContext
; | 613 GrContext* fContext
; |
| 605 | 614 |
| 606 friend class GrPathRendering; | 615 friend class GrPathRendering; |
| 607 typedef SkRefCnt INHERITED; | 616 typedef SkRefCnt INHERITED; |
| 608 }; | 617 }; |
| 609 | 618 |
| 610 #endif | 619 #endif |
| OLD | NEW |