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

Side by Side Diff: Source/core/platform/graphics/Image.cpp

Issue 25627006: Generalize ImageForContainer (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 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 /* 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 Apple Computer, Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006 Apple Computer, 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 norm.setY(norm.y() + norm.height()); 115 norm.setY(norm.y() + norm.height());
116 norm.setHeight(-norm.height()); 116 norm.setHeight(-norm.height());
117 } 117 }
118 return norm; 118 return norm;
119 } 119 }
120 120
121 void Image::draw(GraphicsContext* ctx, const FloatRect& dstRect, const FloatRect & srcRect, CompositeOperator op, BlendMode blendMode, RespectImageOrientationEnu m) 121 void Image::draw(GraphicsContext* ctx, const FloatRect& dstRect, const FloatRect & srcRect, CompositeOperator op, BlendMode blendMode, RespectImageOrientationEnu m)
122 { 122 {
123 draw(ctx, dstRect, srcRect, op, blendMode); 123 draw(ctx, dstRect, srcRect, op, blendMode);
124 } 124 }
125 void Image::drawForContainer(GraphicsContext* context, const FloatSize container Size, float zoom, const FloatRect& dstRect,
126 const FloatRect& srcRect, CompositeOperator compositeOp, BlendMode blendMode )
127 {
128 draw(context, dstRect, srcRect, compositeOp, blendMode);
129 }
130 void Image::drawPatternForContainer(GraphicsContext* context, const FloatSize co ntainerSize, float zoom, const FloatRect& srcRect,
131 const FloatSize& scale, const FloatPoint& phase, CompositeOperator composite Op, const FloatRect& dstRect, BlendMode blendMode)
132 {
133 drawPattern(context, srcRect, scale, phase, compositeOp, dstRect);
134 }
125 135
126 void Image::drawTiled(GraphicsContext* ctxt, const FloatRect& destRect, const Fl oatPoint& srcPoint, const FloatSize& scaledTileSize, CompositeOperator op, Blend Mode blendMode) 136 void Image::drawTiled(GraphicsContext* ctxt, const FloatRect& destRect, const Fl oatPoint& srcPoint, const FloatSize& scaledTileSize, CompositeOperator op, Blend Mode blendMode)
127 { 137 {
128 if (mayFillWithSolidColor()) { 138 if (mayFillWithSolidColor()) {
129 fillWithSolidColor(ctxt, destRect, solidColor(), op); 139 fillWithSolidColor(ctxt, destRect, solidColor(), op);
130 return; 140 return;
131 } 141 }
132 142
133 // See <https://webkit.org/b/59043>. 143 // See <https://webkit.org/b/59043>.
134 ASSERT(!isBitmapImage() || notSolidColor()); 144 ASSERT(!isBitmapImage() || notSolidColor());
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 } 242 }
233 243
234 void Image::computeIntrinsicDimensions(Length& intrinsicWidth, Length& intrinsic Height, FloatSize& intrinsicRatio) 244 void Image::computeIntrinsicDimensions(Length& intrinsicWidth, Length& intrinsic Height, FloatSize& intrinsicRatio)
235 { 245 {
236 intrinsicRatio = size(); 246 intrinsicRatio = size();
237 intrinsicWidth = Length(intrinsicRatio.width(), Fixed); 247 intrinsicWidth = Length(intrinsicRatio.width(), Fixed);
238 intrinsicHeight = Length(intrinsicRatio.height(), Fixed); 248 intrinsicHeight = Length(intrinsicRatio.height(), Fixed);
239 } 249 }
240 250
241 } 251 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698