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

Side by Side Diff: tools/viewer/sk_app/VulkanWindowContext.cpp

Issue 1974983002: Refactor Vulkan image, texture, RTs so that create and getter handles match. (Closed) Base URL: https://skia.googlesource.com/skia.git@fixLayerVersion
Patch Set: nits Created 4 years, 7 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 | « tests/VkWrapTests.cpp ('k') | no next file » | 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 2015 Google Inc. 3 * Copyright 2015 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 #include "GrContext.h" 9 #include "GrContext.h"
10 #include "SkSurface.h" 10 #include "SkSurface.h"
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 fImages = new VkImage[fImageCount]; 248 fImages = new VkImage[fImageCount];
249 fGetSwapchainImagesKHR(fBackendContext->fDevice, fSwapchain, &fImageCount, f Images); 249 fGetSwapchainImagesKHR(fBackendContext->fDevice, fSwapchain, &fImageCount, f Images);
250 250
251 // set up initial image layouts and create surfaces 251 // set up initial image layouts and create surfaces
252 fImageLayouts = new VkImageLayout[fImageCount]; 252 fImageLayouts = new VkImageLayout[fImageCount];
253 fSurfaces = new sk_sp<SkSurface>[fImageCount]; 253 fSurfaces = new sk_sp<SkSurface>[fImageCount];
254 for (uint32_t i = 0; i < fImageCount; ++i) { 254 for (uint32_t i = 0; i < fImageCount; ++i) {
255 fImageLayouts[i] = VK_IMAGE_LAYOUT_UNDEFINED; 255 fImageLayouts[i] = VK_IMAGE_LAYOUT_UNDEFINED;
256 256
257 GrBackendRenderTargetDesc desc; 257 GrBackendRenderTargetDesc desc;
258 GrVkTextureInfo info; 258 GrVkImageInfo info;
259 info.fImage = fImages[i]; 259 info.fImage = fImages[i];
260 info.fAlloc = VK_NULL_HANDLE; 260 info.fAlloc = VK_NULL_HANDLE;
261 info.fImageLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL; 261 info.fImageLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
262 info.fImageTiling = VK_IMAGE_TILING_OPTIMAL; 262 info.fImageTiling = VK_IMAGE_TILING_OPTIMAL;
263 info.fFormat = format; 263 info.fFormat = format;
264 info.fLevelCount = 1; 264 info.fLevelCount = 1;
265 desc.fWidth = fWidth; 265 desc.fWidth = fWidth;
266 desc.fHeight = fHeight; 266 desc.fHeight = fHeight;
267 desc.fConfig = fPixelConfig; 267 desc.fConfig = fPixelConfig;
268 desc.fOrigin = kTopLeft_GrSurfaceOrigin; 268 desc.fOrigin = kTopLeft_GrSurfaceOrigin;
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
581 &fSwapchain, // pSwapchains 581 &fSwapchain, // pSwapchains
582 &backbuffer->fImageIndex, // pImageIndices 582 &backbuffer->fImageIndex, // pImageIndices
583 NULL // pResults 583 NULL // pResults
584 }; 584 };
585 585
586 fQueuePresentKHR(fPresentQueue, &presentInfo); 586 fQueuePresentKHR(fPresentQueue, &presentInfo);
587 587
588 } 588 }
589 589
590 } //namespace sk_app 590 } //namespace sk_app
OLDNEW
« no previous file with comments | « tests/VkWrapTests.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698