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

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

Issue 671653005: SetNeedsRedraw directly when updating a visible tile. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pinchblurmerge-test: comments Created 6 years, 1 month 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/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 #include "ui/gfx/skia_util.h" 8 #include "ui/gfx/skia_util.h"
9 9
10 namespace cc { 10 namespace cc {
(...skipping 22 matching lines...) Expand all
33 draw_rect.right(), 33 draw_rect.right(),
34 draw_rect.bottom(), 34 draw_rect.bottom(),
35 paint); 35 paint);
36 } 36 }
37 37
38 for (BitmapVector::const_iterator it = draw_bitmaps_.begin(); 38 for (BitmapVector::const_iterator it = draw_bitmaps_.begin();
39 it != draw_bitmaps_.end(); ++it) { 39 it != draw_bitmaps_.end(); ++it) {
40 canvas->drawBitmap(it->bitmap, it->point.x(), it->point.y(), &it->paint); 40 canvas->drawBitmap(it->bitmap, it->point.x(), it->point.y(), &it->paint);
41 } 41 }
42 42
43 // Add a rectangle to the middle that doesn't fill |paint_rect| so that solid
44 // color analysis will fail.
45 if (fill_with_nonsolid_color_) { 43 if (fill_with_nonsolid_color_) {
46 gfx::RectF draw_rect = paint_rect; 44 gfx::RectF draw_rect = paint_rect;
47 draw_rect.Inset(draw_rect.width() / 4.0f, draw_rect.height() / 4.0f); 45 bool red = true;
brianderson 2014/10/31 22:42:53 Why is this change needed? Seems unrelated.
danakj 2014/11/03 16:26:04 To make every tile not solid color, ie so blocking
48 SkPaint paint; 46 while (!draw_rect.IsEmpty()) {
49 canvas->drawRectCoords(draw_rect.x(), 47 SkPaint paint;
50 draw_rect.y(), 48 paint.setColor(red ? SK_ColorRED : SK_ColorBLUE);
51 draw_rect.right(), 49 canvas->drawRect(gfx::RectFToSkRect(draw_rect), paint);
52 draw_rect.bottom(), 50 draw_rect.Inset(1, 1);
53 paint); 51 }
54 } 52 }
55 } 53 }
56 54
57 bool FakeContentLayerClient::FillsBoundsCompletely() const { return false; } 55 bool FakeContentLayerClient::FillsBoundsCompletely() const { return false; }
58 56
59 } // namespace cc 57 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698