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

Unified Diff: cc/output/gl_renderer.cc

Issue 22867046: Optimize alpha software PictureDrawQuads. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add TODO to comment Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | cc/output/renderer_pixeltest.cc » ('j') | cc/output/renderer_pixeltest.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/gl_renderer.cc
diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc
index 63d8ea8e8faa55ca969debfbd0276dad50ee60de..099478b8649bf034089b2ba24e7c886038e30acf 100644
--- a/cc/output/gl_renderer.cc
+++ b/cc/output/gl_renderer.cc
@@ -37,6 +37,7 @@
#include "cc/trees/proxy.h"
#include "cc/trees/single_thread_proxy.h"
#include "gpu/GLES2/gl2extchromium.h"
+#include "skia/ext/opacity_draw_filter.h"
#include "third_party/WebKit/public/platform/WebGraphicsContext3D.h"
#include "third_party/khronos/GLES2/gl2.h"
#include "third_party/khronos/GLES2/gl2ext.h"
@@ -1640,8 +1641,6 @@ void GLRenderer::DrawPictureQuadDirectToBackbuffer(
const DrawingFrame* frame,
const PictureDrawQuad* quad) {
DCHECK(CanUseSkiaGPUBackend());
- DCHECK_EQ(quad->opacity(), 1.f) << "Need to composite to a bitmap or a "
- "render surface for non-1 opacity quads";
// TODO(enne): This should be done more lazily / efficiently.
gr_context_->resetContext();
@@ -1670,12 +1669,18 @@ void GLRenderer::DrawPictureQuadDirectToBackbuffer(
&sk_device_matrix);
sk_canvas_->setMatrix(sk_device_matrix);
+ if (quad->opacity() != 1.0f)
tomhudson 2013/08/28 14:55:18 Do you want to debug assert that sk_canvas_->getDr
aelias_OOO_until_Jul13 2013/08/28 18:50:35 Done.
+ sk_canvas_->setDrawFilter(
+ new skia::OpacityDrawFilter(quad->opacity(), false));
+
quad->picture_pile->RasterDirect(
sk_canvas_.get(), quad->content_rect, quad->contents_scale, NULL);
// Flush any drawing buffers that have been deferred.
sk_canvas_->flush();
+ sk_canvas_->setDrawFilter(NULL);
+
// TODO(enne): This should be done more lazily / efficiently.
ReinitializeGLState();
}
« no previous file with comments | « no previous file | cc/output/renderer_pixeltest.cc » ('j') | cc/output/renderer_pixeltest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698