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

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

Issue 2939243002: cc/blink: Veto checker-imaging for multipart image resources. (Closed)
Patch Set: tested Created 3 years, 6 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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 193
194 // Compute the image subset which gets mapped onto |dest|, when the whole 194 // Compute the image subset which gets mapped onto |dest|, when the whole
195 // image is drawn into |tile|. Assumes |tile| contains |dest|. The tile rect 195 // image is drawn into |tile|. Assumes |tile| contains |dest|. The tile rect
196 // is in destination grid space while the return value is in image coordinate 196 // is in destination grid space while the return value is in image coordinate
197 // space. 197 // space.
198 static FloatRect ComputeSubsetForTile(const FloatRect& tile, 198 static FloatRect ComputeSubsetForTile(const FloatRect& tile,
199 const FloatRect& dest, 199 const FloatRect& dest,
200 const FloatSize& image_size); 200 const FloatSize& image_size);
201 201
202 protected: 202 protected:
203 Image(ImageObserver* = 0); 203 Image(ImageObserver* = 0, bool is_multipart = false);
204 204
205 void DrawTiledBackground(GraphicsContext&, 205 void DrawTiledBackground(GraphicsContext&,
206 const FloatRect& dst_rect, 206 const FloatRect& dst_rect,
207 const FloatPoint& src_point, 207 const FloatPoint& src_point,
208 const FloatSize& tile_size, 208 const FloatSize& tile_size,
209 SkBlendMode, 209 SkBlendMode,
210 const FloatSize& repeat_spacing); 210 const FloatSize& repeat_spacing);
211 void DrawTiledBorder(GraphicsContext&, 211 void DrawTiledBorder(GraphicsContext&,
212 const FloatRect& dst_rect, 212 const FloatRect& dst_rect,
213 const FloatRect& src_rect, 213 const FloatRect& src_rect,
(...skipping 15 matching lines...) Expand all
229 RefPtr<SharedBuffer> encoded_image_data_; 229 RefPtr<SharedBuffer> encoded_image_data_;
230 // TODO(Oilpan): consider having Image on the Oilpan heap and 230 // TODO(Oilpan): consider having Image on the Oilpan heap and
231 // turn this into a Member<>. 231 // turn this into a Member<>.
232 // 232 //
233 // The observer (an ImageResourceContent) is responsible for clearing 233 // The observer (an ImageResourceContent) is responsible for clearing
234 // itself out when it switches to another Image. 234 // itself out when it switches to another Image.
235 // When the ImageResourceContent is garbage collected while Image is still 235 // When the ImageResourceContent is garbage collected while Image is still
236 // alive, |image_observer_| is cleared by WeakPersistent mechanism. 236 // alive, |image_observer_| is cleared by WeakPersistent mechanism.
237 WeakPersistent<ImageObserver> image_observer_; 237 WeakPersistent<ImageObserver> image_observer_;
238 PaintImage::Id stable_image_id_; 238 PaintImage::Id stable_image_id_;
239 const bool is_multipart_;
239 }; 240 };
240 241
241 #define DEFINE_IMAGE_TYPE_CASTS(typeName) \ 242 #define DEFINE_IMAGE_TYPE_CASTS(typeName) \
242 DEFINE_TYPE_CASTS(typeName, Image, image, image->Is##typeName(), \ 243 DEFINE_TYPE_CASTS(typeName, Image, image, image->Is##typeName(), \
243 image.Is##typeName()) 244 image.Is##typeName())
244 245
245 } // namespace blink 246 } // namespace blink
246 247
247 #endif 248 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/BitmapImage.cpp ('k') | third_party/WebKit/Source/platform/graphics/Image.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698