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

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

Issue 2026803002: Avoid GPU readback in tex(Sub)Image2D(ImageBitmap) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) 2 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
3 * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 } 335 }
336 336
337 float BitmapImage::frameDurationAtIndex(size_t index) 337 float BitmapImage::frameDurationAtIndex(size_t index)
338 { 338 {
339 if (index < m_frames.size() && m_frames[index].m_haveMetadata) 339 if (index < m_frames.size() && m_frames[index].m_haveMetadata)
340 return m_frames[index].m_duration; 340 return m_frames[index].m_duration;
341 341
342 return m_source.frameDurationAtIndex(index); 342 return m_source.frameDurationAtIndex(index);
343 } 343 }
344 344
345 PassRefPtr<SkImage> BitmapImage::imageForCurrentFrame() 345 PassRefPtr<SkImage> BitmapImage::imageForCurrentFrame(WebGraphicsContext3DProvid er* contextProvider)
346 { 346 {
347 return frameAtIndex(currentFrame()); 347 return frameAtIndex(currentFrame());
Justin Novosad 2016/06/07 15:11:07 If this method is not going to look at contextProv
xidachen 2016/06/07 17:49:53 In my opinion, if this method is called in a test
348 } 348 }
349 349
350 PassRefPtr<Image> BitmapImage::imageForDefaultFrame() 350 PassRefPtr<Image> BitmapImage::imageForDefaultFrame()
351 { 351 {
352 if (frameCount() > 1) { 352 if (frameCount() > 1) {
353 RefPtr<SkImage> firstFrame = frameAtIndex(0); 353 RefPtr<SkImage> firstFrame = frameAtIndex(0);
354 if (firstFrame) 354 if (firstFrame)
355 return StaticBitmapImage::create(firstFrame); 355 return StaticBitmapImage::create(firstFrame);
356 } 356 }
357 357
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
589 589
590 // We need to draw this frame if we advanced to it while not skipping, or if 590 // We need to draw this frame if we advanced to it while not skipping, or if
591 // while trying to skip frames we hit the last frame and thus had to stop. 591 // while trying to skip frames we hit the last frame and thus had to stop.
592 if (skippingFrames != advancedAnimation) 592 if (skippingFrames != advancedAnimation)
593 getImageObserver()->animationAdvanced(this); 593 getImageObserver()->animationAdvanced(this);
594 594
595 return advancedAnimation; 595 return advancedAnimation;
596 } 596 }
597 597
598 } // namespace blink 598 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698