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

Side by Side Diff: cc/playback/discardable_image_map.cc

Issue 2561463002: Add bug to TODO for handling SkImageShader subrects (Closed)
Patch Set: Created 4 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
« no previous file with comments | « no previous file | 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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "cc/playback/discardable_image_map.h" 5 #include "cc/playback/discardable_image_map.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <limits> 10 #include <limits>
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 void AddPaintImage(const SkRect& rect, const SkPaint& paint) { 209 void AddPaintImage(const SkRect& rect, const SkPaint& paint) {
210 SkShader* shader = paint.getShader(); 210 SkShader* shader = paint.getShader();
211 if (shader) { 211 if (shader) {
212 SkMatrix matrix; 212 SkMatrix matrix;
213 SkShader::TileMode xy[2]; 213 SkShader::TileMode xy[2];
214 SkImage* image = shader->isAImage(&matrix, xy); 214 SkImage* image = shader->isAImage(&matrix, xy);
215 if (image) { 215 if (image) {
216 const SkMatrix& ctm = getTotalMatrix(); 216 const SkMatrix& ctm = getTotalMatrix();
217 matrix.postConcat(ctm); 217 matrix.postConcat(ctm);
218 // TODO(ericrk): Handle cases where we only need a sub-rect from the 218 // TODO(ericrk): Handle cases where we only need a sub-rect from the
219 // image. 219 // image. crbug.com/671821
220 AddImage(sk_ref_sp(image), SkRect::MakeFromIRect(image->bounds()), 220 AddImage(sk_ref_sp(image), SkRect::MakeFromIRect(image->bounds()),
221 MapRect(ctm, rect), matrix, &paint); 221 MapRect(ctm, rect), matrix, &paint);
222 } 222 }
223 } 223 }
224 } 224 }
225 225
226 std::vector<std::pair<DrawImage, gfx::Rect>>* image_set_; 226 std::vector<std::pair<DrawImage, gfx::Rect>>* image_set_;
227 const SkRect canvas_bounds_; 227 const SkRect canvas_bounds_;
228 const gfx::Size canvas_size_; 228 const gfx::Size canvas_size_;
229 std::vector<SkPaint> saved_paints_; 229 std::vector<SkPaint> saved_paints_;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 DiscardableImageMap* image_map, 263 DiscardableImageMap* image_map,
264 const gfx::Size& bounds) 264 const gfx::Size& bounds)
265 : image_map_(image_map), 265 : image_map_(image_map),
266 metadata_canvas_(image_map->BeginGeneratingMetadata(bounds)) {} 266 metadata_canvas_(image_map->BeginGeneratingMetadata(bounds)) {}
267 267
268 DiscardableImageMap::ScopedMetadataGenerator::~ScopedMetadataGenerator() { 268 DiscardableImageMap::ScopedMetadataGenerator::~ScopedMetadataGenerator() {
269 image_map_->EndGeneratingMetadata(); 269 image_map_->EndGeneratingMetadata();
270 } 270 }
271 271
272 } // namespace cc 272 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698