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

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

Issue 2855633002: Fix darkened pixels when rendering using GPU (Closed)
Patch Set: 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 481 matching lines...) Expand 10 before | Expand all | Expand 10 after
492 : kUnpremul_SkAlphaType; 492 : kUnpremul_SkAlphaType;
493 } 493 }
494 494
495 SkImageInfo info; 495 SkImageInfo info;
496 if (surface_->ColorSpace()) { 496 if (surface_->ColorSpace()) {
497 info = SkImageInfo::Make(source_rect.Width(), source_rect.Height(), 497 info = SkImageInfo::Make(source_rect.Width(), source_rect.Height(),
498 surface_->ColorType(), alpha_type, 498 surface_->ColorType(), alpha_type,
499 surface_->ColorSpace()); 499 surface_->ColorSpace());
500 } else { 500 } else {
501 info = SkImageInfo::Make(source_rect.Width(), source_rect.Height(), 501 info = SkImageInfo::Make(source_rect.Width(), source_rect.Height(),
502 kRGBA_8888_SkColorType, alpha_type, 502 kRGBA_8888_SkColorType, alpha_type);
503 SkColorSpace::MakeSRGB());
504 } 503 }
505 surface_->WritePixels(info, src_addr, src_bytes_per_row, dest_x, dest_y); 504 surface_->WritePixels(info, src_addr, src_bytes_per_row, dest_x, dest_y);
506 } 505 }
507 506
508 void ImageBuffer::UpdateGPUMemoryUsage() const { 507 void ImageBuffer::UpdateGPUMemoryUsage() const {
509 if (this->IsAccelerated()) { 508 if (this->IsAccelerated()) {
510 // If image buffer is accelerated, we should keep track of GPU memory usage. 509 // If image buffer is accelerated, we should keep track of GPU memory usage.
511 int gpu_buffer_count = 2; 510 int gpu_buffer_count = 2;
512 CheckedNumeric<intptr_t> checked_gpu_usage = 511 CheckedNumeric<intptr_t> checked_gpu_usage =
513 SkColorTypeBytesPerPixel(surface_->ColorType()) * gpu_buffer_count; 512 SkColorTypeBytesPerPixel(surface_->ColorType()) * gpu_buffer_count;
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
625 DCHECK(MIMETypeRegistry::IsSupportedImageMIMETypeForEncoding(mime_type)); 624 DCHECK(MIMETypeRegistry::IsSupportedImageMIMETypeForEncoding(mime_type));
626 625
627 Vector<unsigned char> result; 626 Vector<unsigned char> result;
628 if (!EncodeImage(mime_type, quality, &result)) 627 if (!EncodeImage(mime_type, quality, &result))
629 return "data:,"; 628 return "data:,";
630 629
631 return "data:" + mime_type + ";base64," + Base64Encode(result); 630 return "data:" + mime_type + ";base64," + Base64Encode(result);
632 } 631 }
633 632
634 } // namespace blink 633 } // 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