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

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: should work 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());
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);
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
600 600
601 // We need to draw this frame if we advanced to it while not skipping, or if 601 // We need to draw this frame if we advanced to it while not skipping, or if
602 // while trying to skip frames we hit the last frame and thus had to stop. 602 // while trying to skip frames we hit the last frame and thus had to stop.
603 if (skippingFrames != advancedAnimation) 603 if (skippingFrames != advancedAnimation)
604 getImageObserver()->animationAdvanced(this); 604 getImageObserver()->animationAdvanced(this);
605 605
606 return advancedAnimation; 606 return advancedAnimation;
607 } 607 }
608 608
609 } // namespace blink 609 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698