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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/ImageBuffer.cpp

Issue 2838153003: Fix darkened pixels when rendering using GPU (Closed)
Patch Set: Removing unneeded layout-test Created 3 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 | « content/test/gpu/gpu_tests/pixel_test_pages.py ('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 * Copyright (c) 2008, Google Inc. All rights reserved. 2 * Copyright (c) 2008, Google Inc. All rights reserved.
3 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> 3 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. 4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are 7 * modification, are permitted provided that the following conditions are
8 * met: 8 * met:
9 * 9 *
10 * * Redistributions of source code must retain the above copyright 10 * * Redistributions of source code must retain the above copyright
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 } 483 }
484 484
485 SkImageInfo info; 485 SkImageInfo info;
486 if (surface_->color_params().GetSkColorSpaceForSkSurfaces()) { 486 if (surface_->color_params().GetSkColorSpaceForSkSurfaces()) {
487 info = SkImageInfo::Make( 487 info = SkImageInfo::Make(
488 source_rect.Width(), source_rect.Height(), 488 source_rect.Width(), source_rect.Height(),
489 surface_->color_params().GetSkColorType(), alpha_type, 489 surface_->color_params().GetSkColorType(), alpha_type,
490 surface_->color_params().GetSkColorSpaceForSkSurfaces()); 490 surface_->color_params().GetSkColorSpaceForSkSurfaces());
491 } else { 491 } else {
492 info = SkImageInfo::Make(source_rect.Width(), source_rect.Height(), 492 info = SkImageInfo::Make(source_rect.Width(), source_rect.Height(),
493 kRGBA_8888_SkColorType, alpha_type, 493 kRGBA_8888_SkColorType, alpha_type);
494 SkColorSpace::MakeSRGB());
495 } 494 }
496 surface_->WritePixels(info, src_addr, src_bytes_per_row, dest_x, dest_y); 495 surface_->WritePixels(info, src_addr, src_bytes_per_row, dest_x, dest_y);
497 } 496 }
498 497
499 void ImageBuffer::UpdateGPUMemoryUsage() const { 498 void ImageBuffer::UpdateGPUMemoryUsage() const {
500 if (this->IsAccelerated()) { 499 if (this->IsAccelerated()) {
501 // If image buffer is accelerated, we should keep track of GPU memory usage. 500 // If image buffer is accelerated, we should keep track of GPU memory usage.
502 int gpu_buffer_count = 2; 501 int gpu_buffer_count = 2;
503 CheckedNumeric<intptr_t> checked_gpu_usage = 502 CheckedNumeric<intptr_t> checked_gpu_usage =
504 surface_->color_params().BytesPerPixel() * gpu_buffer_count; 503 surface_->color_params().BytesPerPixel() * gpu_buffer_count;
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 DCHECK(MIMETypeRegistry::IsSupportedImageMIMETypeForEncoding(mime_type)); 596 DCHECK(MIMETypeRegistry::IsSupportedImageMIMETypeForEncoding(mime_type));
598 597
599 Vector<unsigned char> result; 598 Vector<unsigned char> result;
600 if (!EncodeImage(mime_type, quality, &result)) 599 if (!EncodeImage(mime_type, quality, &result))
601 return "data:,"; 600 return "data:,";
602 601
603 return "data:" + mime_type + ";base64," + Base64Encode(result); 602 return "data:" + mime_type + ";base64," + Base64Encode(result);
604 } 603 }
605 604
606 } // namespace blink 605 } // namespace blink
OLDNEW
« no previous file with comments | « content/test/gpu/gpu_tests/pixel_test_pages.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698