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

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

Issue 2712083002: color: Remove blink pre-conversion code (Closed)
Patch Set: Rebase Created 3 years, 9 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 "platform/graphics/PaintGeneratedImage.h" 5 #include "platform/graphics/PaintGeneratedImage.h"
6 6
7 #include "platform/geometry/FloatRect.h" 7 #include "platform/geometry/FloatRect.h"
8 #include "platform/graphics/GraphicsContext.h" 8 #include "platform/graphics/GraphicsContext.h"
9 #include "platform/graphics/paint/PaintRecord.h" 9 #include "platform/graphics/paint/PaintRecord.h"
10 10
11 namespace blink { 11 namespace blink {
12 12
13 void PaintGeneratedImage::draw(PaintCanvas* canvas, 13 void PaintGeneratedImage::draw(PaintCanvas* canvas,
14 const PaintFlags& flags, 14 const PaintFlags& flags,
15 const FloatRect& destRect, 15 const FloatRect& destRect,
16 const FloatRect& srcRect, 16 const FloatRect& srcRect,
17 RespectImageOrientationEnum, 17 RespectImageOrientationEnum,
18 ImageClampingMode, 18 ImageClampingMode) {
19 const ColorBehavior& colorBehavior) {
20 // TODO(ccameron): This function should not ignore |colorBehavior|.
21 // https://crbug.com/672306
22 PaintCanvasAutoRestore ar(canvas, true); 19 PaintCanvasAutoRestore ar(canvas, true);
23 canvas->clipRect(destRect); 20 canvas->clipRect(destRect);
24 canvas->translate(destRect.x(), destRect.y()); 21 canvas->translate(destRect.x(), destRect.y());
25 if (destRect.size() != srcRect.size()) 22 if (destRect.size() != srcRect.size())
26 canvas->scale(destRect.width() / srcRect.width(), 23 canvas->scale(destRect.width() / srcRect.width(),
27 destRect.height() / srcRect.height()); 24 destRect.height() / srcRect.height());
28 canvas->translate(-srcRect.x(), -srcRect.y()); 25 canvas->translate(-srcRect.x(), -srcRect.y());
29 canvas->drawPicture(m_record.get(), nullptr, &flags); 26 canvas->drawPicture(m_record.get(), nullptr, &flags);
30 } 27 }
31 28
32 void PaintGeneratedImage::drawTile(GraphicsContext& context, 29 void PaintGeneratedImage::drawTile(GraphicsContext& context,
33 const FloatRect& srcRect) { 30 const FloatRect& srcRect) {
34 // TODO(ccameron): This function should not ignore |context|'s color behavior.
35 // https://crbug.com/672306
36 context.drawRecord(m_record.get()); 31 context.drawRecord(m_record.get());
37 } 32 }
38 33
39 } // namespace blink 34 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698