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

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

Issue 2880813002: Revert of Add stable id to PaintImage. (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 | « third_party/WebKit/Source/platform/graphics/Image.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 * 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 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
517 return; 517 return;
518 518
519 if (surface->IsRecording()) { 519 if (surface->IsRecording()) {
520 // Using a GPU-backed image with RecordingImageBufferSurface 520 // Using a GPU-backed image with RecordingImageBufferSurface
521 // will fail at playback time. 521 // will fail at playback time.
522 image = image->makeNonTextureImage(); 522 image = image->makeNonTextureImage();
523 } 523 }
524 // TODO(vmpstr): Figure out actual values for this. 524 // TODO(vmpstr): Figure out actual values for this.
525 auto animation_type = PaintImage::AnimationType::UNKNOWN; 525 auto animation_type = PaintImage::AnimationType::UNKNOWN;
526 auto completion_state = PaintImage::CompletionState::UNKNOWN; 526 auto completion_state = PaintImage::CompletionState::UNKNOWN;
527 static PaintImage::Id unknown_stable_id = PaintImage::GetNextId(); 527 surface->Canvas()->drawImage(
528 surface->Canvas()->drawImage(PaintImage(unknown_stable_id, std::move(image), 528 PaintImage(std::move(image), animation_type, completion_state), 0, 0);
529 animation_type, completion_state),
530 0, 0);
531 529
532 surface->SetImageBuffer(this); 530 surface->SetImageBuffer(this);
533 if (client_) 531 if (client_)
534 client_->RestoreCanvasMatrixClipStack(surface->Canvas()); 532 client_->RestoreCanvasMatrixClipStack(surface->Canvas());
535 surface_ = std::move(surface); 533 surface_ = std::move(surface);
536 534
537 UpdateGPUMemoryUsage(); 535 UpdateGPUMemoryUsage();
538 } 536 }
539 537
540 void ImageBuffer::SetNeedsCompositingUpdate() { 538 void ImageBuffer::SetNeedsCompositingUpdate() {
(...skipping 27 matching lines...) Expand all
568 DCHECK(MIMETypeRegistry::IsSupportedImageMIMETypeForEncoding(mime_type)); 566 DCHECK(MIMETypeRegistry::IsSupportedImageMIMETypeForEncoding(mime_type));
569 567
570 Vector<unsigned char> result; 568 Vector<unsigned char> result;
571 if (!EncodeImage(mime_type, quality, &result)) 569 if (!EncodeImage(mime_type, quality, &result))
572 return "data:,"; 570 return "data:,";
573 571
574 return "data:" + mime_type + ";base64," + Base64Encode(result); 572 return "data:" + mime_type + ";base64," + Base64Encode(result);
575 } 573 }
576 574
577 } // namespace blink 575 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/Image.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698