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

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

Issue 2238563002: Fix 4444 on Vulkan devices who don't support RGBA_4444 (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Read back in 8888 Created 4 years, 4 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 | « no previous file | src/gpu/vk/GrVkCaps.h » ('j') | 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 * Copyright 2010 Google Inc. 2 * Copyright 2010 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 8
9 #include "GrGpu.h" 9 #include "GrGpu.h"
10 10
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 ReadPixelTempDrawInfo* tempDrawInfo) { 270 ReadPixelTempDrawInfo* tempDrawInfo) {
271 SkASSERT(drawPreference); 271 SkASSERT(drawPreference);
272 SkASSERT(tempDrawInfo); 272 SkASSERT(tempDrawInfo);
273 SkASSERT(kGpuPrefersDraw_DrawPreference != *drawPreference); 273 SkASSERT(kGpuPrefersDraw_DrawPreference != *drawPreference);
274 274
275 // We currently do not support reading into a compressed buffer 275 // We currently do not support reading into a compressed buffer
276 if (GrPixelConfigIsCompressed(readConfig)) { 276 if (GrPixelConfigIsCompressed(readConfig)) {
277 return false; 277 return false;
278 } 278 }
279 279
280 // We currently do not support reading into the pack formats 565 or 4444 as they are not
281 // required to be renderable formats on all backends.
bsalomon 2016/08/15 16:24:08 I don't know that the fundamental problem is rende
egdaniel 2016/08/15 17:03:01 Done.
282 if (kRGB_565_GrPixelConfig == readConfig || kRGBA_4444_GrPixelConfig == read Config) {
283 return false;
284 }
285
280 if (!this->onGetReadPixelsInfo(srcSurface, width, height, rowBytes, readConf ig, drawPreference, 286 if (!this->onGetReadPixelsInfo(srcSurface, width, height, rowBytes, readConf ig, drawPreference,
281 tempDrawInfo)) { 287 tempDrawInfo)) {
282 return false; 288 return false;
283 } 289 }
284 290
285 // Check to see if we're going to request that the caller draw when drawing is not possible. 291 // Check to see if we're going to request that the caller draw when drawing is not possible.
286 if (!srcSurface->asTexture() || 292 if (!srcSurface->asTexture() ||
287 !this->caps()->isConfigRenderable(tempDrawInfo->fTempSurfaceDesc.fConfig , false)) { 293 !this->caps()->isConfigRenderable(tempDrawInfo->fTempSurfaceDesc.fConfig , false)) {
288 // If we don't have a fallback to a straight read then fail. 294 // If we don't have a fallback to a straight read then fail.
289 if (kRequireDraw_DrawPreference == *drawPreference) { 295 if (kRequireDraw_DrawPreference == *drawPreference) {
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 // This doesn't have geometric meaning. We just need to define an orderi ng for std::map. 489 // This doesn't have geometric meaning. We just need to define an orderi ng for std::map.
484 if (a[i].x() != b[i].x()) { 490 if (a[i].x() != b[i].x()) {
485 return a[i].x() < b[i].x(); 491 return a[i].x() < b[i].x();
486 } 492 }
487 if (a[i].y() != b[i].y()) { 493 if (a[i].y() != b[i].y()) {
488 return a[i].y() < b[i].y(); 494 return a[i].y() < b[i].y();
489 } 495 }
490 } 496 }
491 return false; // Equal. 497 return false; // Equal.
492 } 498 }
OLDNEW
« no previous file with comments | « no previous file | src/gpu/vk/GrVkCaps.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698