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

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

Issue 1685353004: Clean up Image::computeIntrinsicDimensions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address nits Created 4 years, 10 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
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/Image.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 RefPtr<SkShader> shader = createPatternShader(image.get(), localMatrix, paint, 252 RefPtr<SkShader> shader = createPatternShader(image.get(), localMatrix, paint,
253 FloatSize(repeatSpacing.width() / scale.width(), repeatSpacing.heigh t() / scale.height())); 253 FloatSize(repeatSpacing.width() / scale.width(), repeatSpacing.heigh t() / scale.height()));
254 paint.setShader(shader.get()); 254 paint.setShader(shader.get());
255 context.drawRect(destRect, paint); 255 context.drawRect(destRect, paint);
256 } 256 }
257 257
258 if (currentFrameIsLazyDecoded()) 258 if (currentFrameIsLazyDecoded())
259 PlatformInstrumentation::didDrawLazyPixelRef(imageID); 259 PlatformInstrumentation::didDrawLazyPixelRef(imageID);
260 } 260 }
261 261
262 void Image::computeIntrinsicDimensions(Length& intrinsicWidth, Length& intrinsic Height, FloatSize& intrinsicRatio) 262 void Image::computeIntrinsicDimensions(FloatSize& intrinsicSize, FloatSize& intr insicRatio)
263 { 263 {
264 intrinsicRatio = FloatSize(size()); 264 intrinsicSize = intrinsicRatio = FloatSize(size());
265 intrinsicWidth = Length(intrinsicRatio.width(), Fixed);
266 intrinsicHeight = Length(intrinsicRatio.height(), Fixed);
267 } 265 }
268 266
269 PassRefPtr<Image> Image::imageForDefaultFrame() 267 PassRefPtr<Image> Image::imageForDefaultFrame()
270 { 268 {
271 RefPtr<Image> image(this); 269 RefPtr<Image> image(this);
272 270
273 return image.release(); 271 return image.release();
274 } 272 }
275 273
276 bool Image::isTextureBacked() 274 bool Image::isTextureBacked()
277 { 275 {
278 RefPtr<SkImage> image = imageForCurrentFrame(); 276 RefPtr<SkImage> image = imageForCurrentFrame();
279 return image ? image->isTextureBacked() : false; 277 return image ? image->isTextureBacked() : false;
280 } 278 }
281 279
282 } // namespace blink 280 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/Image.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698