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

Side by Side Diff: third_party/WebKit/Source/modules/imagebitmap/ImageBitmapRenderingContext.cpp

Issue 2388423003: reflow comments in modules/[fetch,indexeddb] (Closed)
Patch Set: rebase Created 4 years, 2 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 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "modules/imagebitmap/ImageBitmapRenderingContext.h" 5 #include "modules/imagebitmap/ImageBitmapRenderingContext.h"
6 6
7 #include "bindings/modules/v8/RenderingContext.h" 7 #include "bindings/modules/v8/RenderingContext.h"
8 #include "core/frame/ImageBitmap.h" 8 #include "core/frame/ImageBitmap.h"
9 #include "platform/graphics/GraphicsContext.h" 9 #include "platform/graphics/GraphicsContext.h"
10 #include "platform/graphics/StaticBitmapImage.h" 10 #include "platform/graphics/StaticBitmapImage.h"
(...skipping 21 matching lines...) Expand all
32 m_image.release(); 32 m_image.release();
33 return; 33 return;
34 } 34 }
35 35
36 m_image = imageBitmap->bitmapImage(); 36 m_image = imageBitmap->bitmapImage();
37 if (!m_image) 37 if (!m_image)
38 return; 38 return;
39 39
40 sk_sp<SkImage> skImage = m_image->imageForCurrentFrame(); 40 sk_sp<SkImage> skImage = m_image->imageForCurrentFrame();
41 if (skImage->isTextureBacked()) { 41 if (skImage->isTextureBacked()) {
42 // TODO(junov): crbug.com/585607 Eliminate this readback and use an External TextureLayer 42 // TODO(junov): crbug.com/585607 Eliminate this readback and use an
43 // ExternalTextureLayer
43 sk_sp<SkSurface> surface = 44 sk_sp<SkSurface> surface =
44 SkSurface::MakeRasterN32Premul(skImage->width(), skImage->height()); 45 SkSurface::MakeRasterN32Premul(skImage->width(), skImage->height());
45 if (!surface) { 46 if (!surface) {
46 // silent failure 47 // silent failure
47 m_image.clear(); 48 m_image.clear();
48 return; 49 return;
49 } 50 }
50 surface->getCanvas()->drawImage(skImage, 0, 0); 51 surface->getCanvas()->drawImage(skImage, 0, 0);
51 m_image = StaticBitmapImage::create(surface->makeImageSnapshot()); 52 m_image = StaticBitmapImage::create(surface->makeImageSnapshot());
52 } 53 }
(...skipping 21 matching lines...) Expand all
74 if (!RuntimeEnabledFeatures::experimentalCanvasFeaturesEnabled()) 75 if (!RuntimeEnabledFeatures::experimentalCanvasFeaturesEnabled())
75 return nullptr; 76 return nullptr;
76 return new ImageBitmapRenderingContext(canvas, attrs, document); 77 return new ImageBitmapRenderingContext(canvas, attrs, document);
77 } 78 }
78 79
79 void ImageBitmapRenderingContext::stop() { 80 void ImageBitmapRenderingContext::stop() {
80 m_image.clear(); 81 m_image.clear();
81 } 82 }
82 83
83 } // blink 84 } // blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/gamepad/NavigatorGamepad.cpp ('k') | third_party/WebKit/Source/modules/indexeddb/IDBAny.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698