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

Side by Side Diff: cc/resources/picture.cc

Issue 595553002: Use the skmultipicture to perform GPU rasterization (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/resources/picture.h" 5 #include "cc/resources/picture.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <set> 9 #include <set>
10 10
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 343
344 canvas->save(); 344 canvas->save();
345 345
346 for (Region::Iterator it(negated_content_region); it.has_rect(); it.next()) 346 for (Region::Iterator it(negated_content_region); it.has_rect(); it.next())
347 canvas->clipRect(gfx::RectToSkRect(it.rect()), SkRegion::kDifference_Op); 347 canvas->clipRect(gfx::RectToSkRect(it.rect()), SkRegion::kDifference_Op);
348 348
349 canvas->scale(contents_scale, contents_scale); 349 canvas->scale(contents_scale, contents_scale);
350 canvas->translate(layer_rect_.x(), layer_rect_.y()); 350 canvas->translate(layer_rect_.x(), layer_rect_.y());
351 if (playback_) { 351 if (playback_) {
352 playback_->draw(canvas); 352 playback_->draw(canvas);
353 } else if (callback) {
354 picture_->draw(canvas, callback); // AnalysisCanvas
353 } else { 355 } else {
354 picture_->draw(canvas, callback); 356 canvas->drawPicture(picture_.get());
355 } 357 }
reveman 2014/09/22 21:29:05 I assume this is the fix for picture ops being bei
hendrikw 2014/09/22 21:48:39 I'd rather not separate these. I can put more det
reveman 2014/09/22 22:41:08 Ok, a comment here would be useful as it's not obv
robertphillips 2014/09/23 12:54:55 We have renamed SkPicture::draw to be SkPicture::p
reveman 2014/09/23 14:59:46 Ok, that makes sense. We should probably change th
356 SkIRect bounds; 358 SkIRect bounds;
357 canvas->getClipDeviceBounds(&bounds); 359 canvas->getClipDeviceBounds(&bounds);
358 canvas->restore(); 360 canvas->restore();
359 TRACE_EVENT_END1( 361 TRACE_EVENT_END1(
360 "cc", "Picture::Raster", 362 "cc", "Picture::Raster",
361 "num_pixels_rasterized", bounds.width() * bounds.height()); 363 "num_pixels_rasterized", bounds.width() * bounds.height());
362 return bounds.width() * bounds.height(); 364 return bounds.width() * bounds.height();
363 } 365 }
364 366
365 void Picture::Replay(SkCanvas* canvas) { 367 void Picture::Replay(SkCanvas* canvas) {
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 scoped_refptr<base::debug::TracedValue> record_data = 543 scoped_refptr<base::debug::TracedValue> record_data =
542 new base::debug::TracedValue(); 544 new base::debug::TracedValue();
543 TracedValue::SetIDRef(this, record_data.get(), "picture_id"); 545 TracedValue::SetIDRef(this, record_data.get(), "picture_id");
544 record_data->BeginArray("layer_rect"); 546 record_data->BeginArray("layer_rect");
545 MathUtil::AddToTracedValue(layer_rect_, record_data.get()); 547 MathUtil::AddToTracedValue(layer_rect_, record_data.get());
546 record_data->EndArray(); 548 record_data->EndArray();
547 return record_data; 549 return record_data;
548 } 550 }
549 551
550 } // namespace cc 552 } // namespace cc
OLDNEW
« cc/resources/gpu_raster_worker_pool.cc ('K') | « cc/resources/gpu_raster_worker_pool.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698