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

Side by Side Diff: cc/tiles/image_controller.cc

Issue 2857923004: cc: Keep PaintImage in DrawImage. (Closed)
Patch Set: .. Created 3 years, 7 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 | « cc/tiles/gpu_image_decode_cache_unittest.cc ('k') | cc/tiles/software_image_decode_cache.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "cc/tiles/image_controller.h" 5 #include "cc/tiles/image_controller.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/task_scheduler/post_task.h" 8 #include "base/task_scheduler/post_task.h"
9 #include "base/task_scheduler/task_traits.h" 9 #include "base/task_scheduler/task_traits.h"
10 #include "base/threading/thread_restrictions.h" 10 #include "base/threading/thread_restrictions.h"
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 188
189 // TODO(ccameron): The target color space specified here should match the 189 // TODO(ccameron): The target color space specified here should match the
190 // target color space that will be used at rasterization time. Leave this 190 // target color space that will be used at rasterization time. Leave this
191 // unspecified now, since that will match the rasterization-time color 191 // unspecified now, since that will match the rasterization-time color
192 // space while color correct rendering is disabled. 192 // space while color correct rendering is disabled.
193 gfx::ColorSpace target_color_space; 193 gfx::ColorSpace target_color_space;
194 194
195 DCHECK(image); 195 DCHECK(image);
196 bool is_image_lazy = image->isLazyGenerated(); 196 bool is_image_lazy = image->isLazyGenerated();
197 auto image_bounds = image->bounds(); 197 auto image_bounds = image->bounds();
198 DrawImage draw_image(std::move(image), image_bounds, kNone_SkFilterQuality, 198 // TODO(khushalsagar): Eliminate the use of an incorrect id here and have all
199 SkMatrix::I(), target_color_space); 199 // call-sites provide PaintImage to the ImageController.
200 DrawImage draw_image(
201 PaintImage(PaintImage::kUnknownStableId,
202 sk_sp<SkImage>(const_cast<SkImage*>(image.release()))),
203 image_bounds, kNone_SkFilterQuality, SkMatrix::I(), target_color_space);
200 204
201 // Get the tasks for this decode. 205 // Get the tasks for this decode.
202 scoped_refptr<TileTask> task; 206 scoped_refptr<TileTask> task;
203 bool need_unref = false; 207 bool need_unref = false;
204 if (is_image_lazy) { 208 if (is_image_lazy) {
205 need_unref = 209 need_unref =
206 cache_->GetOutOfRasterDecodeTaskForImageAndRef(draw_image, &task); 210 cache_->GetOutOfRasterDecodeTaskForImageAndRef(draw_image, &task);
207 } 211 }
208 // If we don't need to unref this, we don't actually have a task. 212 // If we don't need to unref this, we don't actually have a task.
209 DCHECK(need_unref || !task); 213 DCHECK(need_unref || !task);
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 ImageController::ImageDecodeRequest::ImageDecodeRequest( 378 ImageController::ImageDecodeRequest::ImageDecodeRequest(
375 const ImageDecodeRequest& other) = default; 379 const ImageDecodeRequest& other) = default;
376 ImageController::ImageDecodeRequest::~ImageDecodeRequest() = default; 380 ImageController::ImageDecodeRequest::~ImageDecodeRequest() = default;
377 381
378 ImageController::ImageDecodeRequest& ImageController::ImageDecodeRequest:: 382 ImageController::ImageDecodeRequest& ImageController::ImageDecodeRequest::
379 operator=(ImageDecodeRequest&& other) = default; 383 operator=(ImageDecodeRequest&& other) = default;
380 ImageController::ImageDecodeRequest& ImageController::ImageDecodeRequest:: 384 ImageController::ImageDecodeRequest& ImageController::ImageDecodeRequest::
381 operator=(const ImageDecodeRequest& other) = default; 385 operator=(const ImageDecodeRequest& other) = default;
382 386
383 } // namespace cc 387 } // namespace cc
OLDNEW
« no previous file with comments | « cc/tiles/gpu_image_decode_cache_unittest.cc ('k') | cc/tiles/software_image_decode_cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698