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

Side by Side Diff: cc/test/fake_content_layer_client.cc

Issue 14205005: cc: Only consider layer clipped content rect for analysis (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: linker fixes on windows Created 7 years, 8 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/test/fake_content_layer_client.h ('k') | cc/test/fake_picture_pile_impl.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 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/test/fake_content_layer_client.h" 5 #include "cc/test/fake_content_layer_client.h"
6 6
7 #include "third_party/skia/include/core/SkCanvas.h" 7 #include "third_party/skia/include/core/SkCanvas.h"
8 8
9 namespace cc { 9 namespace cc {
10 10
11 FakeContentLayerClient::FakeContentLayerClient() 11 FakeContentLayerClient::FakeContentLayerClient()
12 : paint_all_opaque_(false) { 12 : paint_all_opaque_(false) {
13 } 13 }
14 14
15 FakeContentLayerClient::~FakeContentLayerClient() { 15 FakeContentLayerClient::~FakeContentLayerClient() {
16 } 16 }
17 17
18 void FakeContentLayerClient::PaintContents(SkCanvas* canvas, 18 void FakeContentLayerClient::PaintContents(SkCanvas* canvas,
19 gfx::Rect rect, gfx::RectF* opaque_rect) { 19 gfx::Rect rect, gfx::RectF* opaque_rect) {
20 if (paint_all_opaque_) 20 if (paint_all_opaque_)
21 *opaque_rect = rect; 21 *opaque_rect = rect;
22 22
23 SkPaint paint; 23 for (RectPaintVector::const_iterator it = draw_rects_.begin();
24 for (RectVector::const_iterator rect_it = draw_rects_.begin(); 24 it < draw_rects_.end(); ++it) {
25 rect_it < draw_rects_.end(); rect_it++) { 25 gfx::Rect rect = it->first;
26 SkRect draw_rect = SkRect::MakeXYWH(rect_it->x(), rect_it->y(), 26 SkPaint paint = it->second;
27 rect_it->width(), rect_it->height()); 27 SkRect draw_rect = SkRect::MakeXYWH(
28 rect.x(),
29 rect.y(),
30 rect.width(),
31 rect.height());
28 canvas->drawRect(draw_rect, paint); 32 canvas->drawRect(draw_rect, paint);
29 } 33 }
30 } 34 }
31 35
32 } // namespace cc 36 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/fake_content_layer_client.h ('k') | cc/test/fake_picture_pile_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698