OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 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 #include "Test.h" | 8 #include "Test.h" |
9 #if SK_SUPPORT_GPU | 9 #if SK_SUPPORT_GPU |
10 #include "gl/GrGLGpu.h" | 10 #include "gl/GrGLGpu.h" |
11 #include "gl/GLContext.h" | |
jvanverth1
2016/03/28 20:26:35
One thing about the renaming is that it's not clea
bsalomon
2016/03/28 20:46:25
I like that and don't mind doing it. Maybe as a fo
jvanverth1
2016/03/29 13:39:15
A followup would be better -- there's a lot to loo
| |
11 #include "GrContext.h" | 12 #include "GrContext.h" |
12 #include "SkSurface_Gpu.h" | 13 #include "SkSurface_Gpu.h" |
13 #include "../include/gpu/gl/SkGLContext.h" | |
14 #include "../include/gpu/GrTypes.h" | 14 #include "../include/gpu/GrTypes.h" |
15 #include "../include/private/SkTemplates.h" | 15 #include "../include/private/SkTemplates.h" |
16 | 16 |
17 class TestStorageAllocator { | 17 class TestStorageAllocator { |
18 public: | 18 public: |
19 static GrTextureStorageAllocator::Result allocateTextureStorage(void* ctx, | 19 static GrTextureStorageAllocator::Result allocateTextureStorage(void* ctx, |
20 GrBackendObject texture, unsigned width, unsigned height, GrPixelConfi g config, | 20 GrBackendObject texture, unsigned width, unsigned height, GrPixelConfi g config, |
21 const void* srcData, GrSurfaceOrigin) { | 21 const void* srcData, GrSurfaceOrigin) { |
22 TestStorageAllocator* allocator = static_cast<TestStorageAllocator*>(ctx); | 22 TestStorageAllocator* allocator = static_cast<TestStorageAllocator*>(ctx); |
23 if (!allocator->m_allowAllocation) | 23 if (!allocator->m_allowAllocation) |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
100 grAllocator.fAllocateTextureStorage = &TestStorageAllocator::allocateTexture Storage; | 100 grAllocator.fAllocateTextureStorage = &TestStorageAllocator::allocateTexture Storage; |
101 grAllocator.fDeallocateTextureStorage= &TestStorageAllocator::deallocateText ureStorage; | 101 grAllocator.fDeallocateTextureStorage= &TestStorageAllocator::deallocateText ureStorage; |
102 grAllocator.fCtx = &allocator; | 102 grAllocator.fCtx = &allocator; |
103 auto surface(SkSurface_Gpu::MakeRenderTarget( | 103 auto surface(SkSurface_Gpu::MakeRenderTarget( |
104 context, SkBudgeted::kNo, SkImageInfo::MakeN32Premul(kWidth, kHeight ), 0, | 104 context, SkBudgeted::kNo, SkImageInfo::MakeN32Premul(kWidth, kHeight ), 0, |
105 NULL, grAllocator)); | 105 NULL, grAllocator)); |
106 REPORTER_ASSERT(reporter, !surface); | 106 REPORTER_ASSERT(reporter, !surface); |
107 } | 107 } |
108 | 108 |
109 #endif | 109 #endif |
OLD | NEW |