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

Side by Side Diff: Source/core/frame/ImageBitmap.cpp

Issue 749653002: WebGL: clarify which Front or Back buffer is used by each API. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Address nits Created 6 years 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "config.h" 5 #include "config.h"
6 #include "core/frame/ImageBitmap.h" 6 #include "core/frame/ImageBitmap.h"
7 7
8 #include "core/html/HTMLCanvasElement.h" 8 #include "core/html/HTMLCanvasElement.h"
9 #include "core/html/HTMLVideoElement.h" 9 #include "core/html/HTMLVideoElement.h"
10 #include "core/html/ImageData.h" 10 #include "core/html/ImageData.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 m_bitmapRect = IntRect(IntPoint(std::max(0, -cropRect.x()), std::max(0, -cro pRect.y())), srcRect.size()); 75 m_bitmapRect = IntRect(IntPoint(std::max(0, -cropRect.x()), std::max(0, -cro pRect.y())), srcRect.size());
76 } 76 }
77 77
78 ImageBitmap::ImageBitmap(HTMLCanvasElement* canvas, const IntRect& cropRect) 78 ImageBitmap::ImageBitmap(HTMLCanvasElement* canvas, const IntRect& cropRect)
79 : m_imageElement(nullptr) 79 : m_imageElement(nullptr)
80 , m_cropRect(cropRect) 80 , m_cropRect(cropRect)
81 , m_bitmapOffset(IntPoint()) 81 , m_bitmapOffset(IntPoint())
82 { 82 {
83 CanvasRenderingContext* sourceContext = canvas->renderingContext(); 83 CanvasRenderingContext* sourceContext = canvas->renderingContext();
84 if (sourceContext && sourceContext->is3d()) 84 if (sourceContext && sourceContext->is3d())
85 sourceContext->paintRenderingResultsToCanvas(CanvasRenderingContext::Bac k); 85 sourceContext->paintRenderingResultsToCanvas(BackBuffer);
86 86
87 IntRect srcRect = intersection(cropRect, IntRect(IntPoint(), canvas->size()) ); 87 IntRect srcRect = intersection(cropRect, IntRect(IntPoint(), canvas->size()) );
88 m_bitmapRect = IntRect(IntPoint(std::max(0, -cropRect.x()), std::max(0, -cro pRect.y())), srcRect.size()); 88 m_bitmapRect = IntRect(IntPoint(std::max(0, -cropRect.x()), std::max(0, -cro pRect.y())), srcRect.size());
89 m_bitmap = cropImage(canvas->buffer()->copyImage(CopyBackingStore).get(), cr opRect); 89 m_bitmap = cropImage(canvas->buffer()->copyImage(CopyBackingStore).get(), cr opRect);
90 } 90 }
91 91
92 ImageBitmap::ImageBitmap(ImageData* data, const IntRect& cropRect) 92 ImageBitmap::ImageBitmap(ImageData* data, const IntRect& cropRect)
93 : m_imageElement(nullptr) 93 : m_imageElement(nullptr)
94 , m_cropRect(cropRect) 94 , m_cropRect(cropRect)
95 , m_bitmapOffset(IntPoint()) 95 , m_bitmapOffset(IntPoint())
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 return FloatSize(width(), height()); 217 return FloatSize(width(), height());
218 } 218 }
219 219
220 void ImageBitmap::trace(Visitor* visitor) 220 void ImageBitmap::trace(Visitor* visitor)
221 { 221 {
222 visitor->trace(m_imageElement); 222 visitor->trace(m_imageElement);
223 ImageLoaderClient::trace(visitor); 223 ImageLoaderClient::trace(visitor);
224 } 224 }
225 225
226 } // namespace blink 226 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698