Index: cc/output/software_renderer.cc |
diff --git a/cc/output/software_renderer.cc b/cc/output/software_renderer.cc |
index ed5c18b330ec877b9308eb2ff62b34c8ad45f79a..247e4b8e71ba247d7677590276e6eba3f276426a 100644 |
--- a/cc/output/software_renderer.cc |
+++ b/cc/output/software_renderer.cc |
@@ -19,7 +19,7 @@ |
#include "cc/quads/solid_color_draw_quad.h" |
#include "cc/quads/texture_draw_quad.h" |
#include "cc/quads/tile_draw_quad.h" |
-#include "third_party/skia/include/core/SkBitmapDevice.h" |
+#include "skia/ext/opacity_draw_filter.h" |
#include "third_party/skia/include/core/SkCanvas.h" |
#include "third_party/skia/include/core/SkColor.h" |
#include "third_party/skia/include/core/SkMatrix.h" |
@@ -311,27 +311,18 @@ void SoftwareRenderer::DrawPictureQuad(const DrawingFrame* frame, |
SkMatrix::kFill_ScaleToFit); |
current_canvas_->concat(content_matrix); |
- if (quad->ShouldDrawWithBlending()) { |
- TRACE_EVENT0("cc", "SoftwareRenderer::DrawPictureQuad with blending"); |
- SkBitmap temp_bitmap; |
- temp_bitmap.setConfig(SkBitmap::kARGB_8888_Config, |
- quad->texture_size.width(), |
- quad->texture_size.height()); |
- temp_bitmap.allocPixels(); |
- SkBitmapDevice temp_device(temp_bitmap); |
- SkCanvas temp_canvas(&temp_device); |
- |
- quad->picture_pile->RasterToBitmap( |
- &temp_canvas, quad->content_rect, quad->contents_scale, NULL); |
+ // http://crbug.com/280374 - Applying opacity to each individual draw call is |
joth
2013/08/28 03:29:12
Is this a TODO, or an explanation of what is alrea
|
+ // often incorrect. We should detect these cases and fall back to a persistent |
+ // bitmap backing. |
+ current_canvas_->setDrawFilter(new skia::OpacityDrawFilter(quad->opacity(), |
+ true)); |
- current_paint_.setFilterBitmap(true); |
- current_canvas_->drawBitmap(temp_bitmap, 0, 0, ¤t_paint_); |
- } else { |
- TRACE_EVENT0("cc", |
- "SoftwareRenderer::DrawPictureQuad direct from PicturePile"); |
- quad->picture_pile->RasterDirect( |
- current_canvas_, quad->content_rect, quad->contents_scale, NULL); |
- } |
+ TRACE_EVENT0("cc", |
+ "SoftwareRenderer::DrawPictureQuad"); |
+ quad->picture_pile->RasterDirect( |
+ current_canvas_, quad->content_rect, quad->contents_scale, NULL); |
+ |
+ current_canvas_->setDrawFilter(NULL); |
} |
void SoftwareRenderer::DrawSolidColorQuad(const DrawingFrame* frame, |